GetMethods(); $bridgeHasMethod = false; foreach($bridgeMethods as $method){ if($method->name === 'getCacheDuration' && $method->class === $bridgeReflector->name){ $bridgeHasMethod = true; //break; } } if(!$bridgeHasMethod) return; $bridge = new $bridgeName(); $abstract = new BridgeAbstractTest(); $this->assertNotEquals($bridge->getCacheDuration(), $abstract->getCacheDuration(), $bridgeName . ' seems to implement \'getCacheDuration\' with default values, so you might safely remove it'); $this->assertNotEquals($bridge->getCacheDuration(), 0, $bridgeName . ' seems to implement \'getCacheDuration\' with value 0, which should not be allowed.'); } } public function testBridgeImplementation($bridgeName){ require_once('bridges/' . $bridgeName . '.php'); $this->CheckBridgePublicFunctions($bridgeName); $this->CheckBridgeGetCacheDurationDefaultValue($bridgeName); } public function count() { return count($this->ListBridges()); } public function run(PHPUnit_Framework_TestResult $result = NULL) { if ($result === NULL) { $result = new PHPUnit_Framework_TestResult; } foreach ($this->ListBridges() as $bridge) { $result->startTest($this); PHP_Timer::start(); $stopTime = NULL; //list($expected, $actual) = explode(';', $bridge); try { $this->testBridgeImplementation($bridge); } catch (PHPUnit_Framework_AssertionFailedError $e) { $stopTime = PHP_Timer::stop(); $result->addFailure($this, $e, $stopTime); } catch (Exception $e) { $stopTime = PHP_Timer::stop(); $result->addError($this, $e, $stopTime); } if ($stopTime === NULL) { $stopTime = PHP_Timer::stop(); } $result->endTest($this, $stopTime); } return $result; } } /* This class is used for testing default values of 'getCacheDuration'! It must not return any values, just implement all abstract functions! */ class BridgeAbstractTest extends BridgeAbstract{ public function loadMetadatas(){} public function collectData(){} public function getName(){return '';} public function getURI(){return '';} }