[limb-svn] r6284 - 3.x/trunk/limb/view/tests/cases

svn at limb-project.com svn at limb-project.com
Mon Sep 10 14:44:20 MSD 2007


Author: korchasa
Date: 2007-09-10 14:44:20 +0400 (Mon, 10 Sep 2007)
New Revision: 6284
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6284

Modified:
   3.x/trunk/limb/view/tests/cases/lmbBlitzViewTest.class.php
Log:
skip tests if extension not installed

Modified: 3.x/trunk/limb/view/tests/cases/lmbBlitzViewTest.class.php
===================================================================
--- 3.x/trunk/limb/view/tests/cases/lmbBlitzViewTest.class.php	2007-09-10 08:31:55 UTC (rev 6283)
+++ 3.x/trunk/limb/view/tests/cases/lmbBlitzViewTest.class.php	2007-09-10 10:44:20 UTC (rev 6284)
@@ -10,6 +10,12 @@
 
 class lmbBlitzViewTest extends UnitTestCase
 {
+    function skip()
+    {
+        $this->skipIf(!extension_loaded('blitz'), 'Blitz extension not found. Test skipped.');
+        $this->skipIf(!class_exists('Blitz'), 'Blitz class not found. Test skipped.');
+    }
+
     private function _createTemplateFile($name, $source)
     {
         file_put_contents($path = LIMB_VAR_DIR . $name, $source);
@@ -27,20 +33,20 @@
 
         $this->assertEqual($view->render(), 'Hello message!Hello again!');
     }
-    
+
     function testManualTemplateFunctionCall()
     {
         $template = '{{BEGIN foo}}{{END}}';
         $path = $this->_createTemplateFile('/simple.bhtml', $template);
 
-        $view = new lmbBlitzView($path);        
+        $view = new lmbBlitzView($path);
         $this->assertTrue($view->hasContext('foo'));
         $this->assertFalse($view->hasContext('bar'));
     }
 
     function testRenderIteratedTemplates()
     {
-        $template = 
+        $template =
             '{{ BEGIN outer }}o'
                 .'{{ $ovar }}'
                 .'{{ BEGIN inner }}i'
@@ -66,9 +72,9 @@
                         ),
                 )
         );
-        
+
         $out = 'oai1i2i3obi4i5i6';
-        
+
         $path = $this->_createTemplateFile('/iteration.bhtml', $template);
 
         $view = new lmbBlitzView($path);
@@ -76,5 +82,5 @@
 
         $this->assertEqual($view->render(), $out);
     }
-    
+
 }



More information about the limb-svn mailing list