Changeset 3265 for trunk/modules

Show
Ignore:
Timestamp:
08/05/2008 02:29:29 PM (4 months ago)
Author:
Geert
Message:

Now using a class constant (instead of a property) to disable a unit test case. A constant fits more in the unchangeable nature of the setting. Also cleaner on the Reflection part.

Location:
trunk/modules/unit_test
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/unit_test/libraries/Unit_Test.php

    r3252 r3265  
    8888 
    8989                                // Skip disabled Tests 
    90                                 if ($reflector->hasProperty('DISABLED')) 
    91                                 { 
    92                                         $property = new ReflectionProperty($class, 'DISABLED'); 
    93                                         if ($property->getValue(new $class) === TRUE) 
    94                                                 continue; 
    95                                 } 
     90                                if ($reflector->getConstant('DISABLED') === TRUE) 
     91                                        continue; 
    9692 
    9793                                // Initialize setup and teardown method triggers 
  • trunk/modules/unit_test/tests/Example_Test.php

    r3132 r3265  
    1212class Example_Test extends Unit_Test_Case { 
    1313 
    14         // public $DISABLED = TRUE; // Disables this Test class 
     14        // Disable this Test class? 
     15        const DISABLED = FALSE; 
    1516 
    1617        public $setup_has_run = FALSE;