Author: caefer
Date: 2010-03-23 16:44:51 +0100 (Tue, 23 Mar 2010)
New Revision: 28716
Modified:
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/cache/sfRawFileCacheTest.php
Log:
achieved greater code coverage
Modified:
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/cache/sfRawFileCacheTest.php
===================================================================
---
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/cache/sfRawFileCacheTest.php
2010-03-23 15:28:37 UTC (rev 28715)
+++
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/cache/sfRawFileCacheTest.php
2010-03-23 15:44:51 UTC (rev 28716)
@@ -36,6 +36,14 @@
$this->assertEquals(false, $this->cache->has('any_key'));
}
+ public function testWrite()
+ {
+ $dispatcher = new sfEventDispatcher();
+ $response = new sfWebResponse($dispatcher);
+ // test set as write is protected
+ $this->assertEquals(true, $this->cache->set('any/key',
serialize($response)));
+ }
+
public function testRemovePattern()
{
$this->markTestIncomplete('This test has not been implemented yet.');
@@ -51,19 +59,22 @@
$this->assertEquals(0, $this->cache->getTimeout('any_key'));
}
- protected function setUp()
+ private function getCache($dir)
{
- $this->cache = new sfRawFileCache(array(
+ return new sfRawFileCache(array(
'automatic_cleaning_factor' => 0,
- 'cache_dir' => '/dev/null',
- 'lifetime' => 10,
- 'prefix' => '/var/www/ical.ly/symfon/apps/frontend/template'
+ 'cache_dir' => $dir,
));
}
+ protected function setUp()
+ {
+ $this->cache =
$this->getCache(sfConfig::get('sf_cache_dir').'/sfImageTransformExtraPluginUnitTests');
+ }
+
protected function tearDown()
{
- unset($this->cache);
+ exec('rm -rf
'.sfConfig::get('sf_cache_dir').'/sfImageTransformExtraPluginUnitTests');
}
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.