/** * Scans the now complete ignore list, and adds * all parent classes to the list. If a class * is not a runnable test case, then it's parents * wouldn't be either. This is syntactic sugar * to cut down on ommissions of ignore()'s or * missing abstract declarations. This cannot * be done whilst loading classes wiithout forcing * a particular order on the class declarations and * the ignore() calls. It's just nice to have the ignore() * calls at the top of the file before the actual declarations. * @param array $classes Class names of interest. * @static * @access public */ function ignoreParentsIfIgnored($classes) { $registry = &SimpleTest::_getRegistry(); foreach ($classes as $class) { if (SimpleTest::isIgnored($class)) { $reflection = new SimpleReflection($class); if ($parent = $reflection->getParent()) { SimpleTest::ignore($parent); } } } }
/** * Scans the now complete ignore list, and adds * all parent classes to the list. If a class * is not a runnable test case, then it's parents * wouldn't be either. This is syntactic sugar * to cut down on ommissions of ignore()'s or * missing abstract declarations. This cannot * be done whilst loading classes wiithout forcing * a particular order on the class declarations and * the ignore() calls. It's just nice to have the ignore() * calls at the top of the file before the actual declarations. * @param array $classes Class names of interest. */ public static function ignoreParentsIfIgnored($classes) { foreach ($classes as $class) { if (SimpleTest::isIgnored($class)) { $reflection = new SimpleReflection($class); $parent = $reflection->getParent(); if ($parent) { SimpleTest::ignore($parent); } } } }
function testFindingParentClass() { $reflection = new SimpleReflection('AnyOldChildThing'); $this->assertEqual(strtolower($reflection->getParent()), 'anyoldthing'); }
function testFindingParentClass() { $reflection = new SimpleReflection('AnyOldSubclass'); $this->assertEqual($reflection->getParent(), 'AnyOldImplementation'); }