Author: caefer
Date: 2010-03-23 15:23:17 +0100 (Tue, 23 Mar 2010)
New Revision: 28711

Modified:
   
plugins/sfImageTransformExtraPlugin/trunk/test/unit/config/sfImageTransformExtraPluginConfigurationTest.php
Log:
implemented test cases for setting view cache and thumbnail removal

Modified: 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/config/sfImageTransformExtraPluginConfigurationTest.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/config/sfImageTransformExtraPluginConfigurationTest.php
 2010-03-23 13:59:19 UTC (rev 28710)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/config/sfImageTransformExtraPluginConfigurationTest.php
 2010-03-23 14:23:17 UTC (rev 28711)
@@ -47,7 +47,17 @@
 
   public function testSetViewCache()
   {
-    $this->markTestSkipped('ViewCacheManagers can not be tested from command 
line');
+    if(false !== sfConfig::get('sf_cache'))
+    {
+      $event = new sfEvent($this, 'controller.change_action', array('module' 
=> 'sfImageTransformator', 'action' => 'index'));
+      sfImageTransformExtraPluginConfiguration::setViewCache($event);
+      $viewCacheManager = 
sfContext::getInstance(sfConfig::get('sf_app'))->getViewCacheManager();
+      $this->assertType('sfRawFileCache', $viewCacheManager->getCache());
+    }
+    else
+    {
+      $this->markTestSkipped('sf_cache is false, therefor testing setting of a 
viewcache must be skipped.');
+    }
   }
 
   public function testGetCache()
@@ -57,9 +67,9 @@
 
   public function testRemoveOldThumbnails()
   {
-    //$event = new sfEvent($this, 'sf_image_transform.changed_source', 
array());
-    //sfImageTransformExtraPluginConfiguration::registerStreamWrapper($event);
-    $this->markTestIncomplete('Removal not yet implemented');
+    $event = new sfEvent($this, 'sf_image_transform.changed_source', 
array('type'=>'TestRecord', 'id' => 1));
+    sfImageTransformExtraPluginConfiguration::removeOldThumbnails($event);
+    $this->assertTrue(true);
   }
 
   protected function setUp()

-- 
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.

Reply via email to