setName( $theClass ); return; } if ( !$argumentsValid ) { throw new InvalidArgumentException(); } if ( $name != '' ) { $this->setName( $name ); } else { $this->setName( $theClass->getName() ); } $constructor = $theClass->getConstructor(); if ( $constructor !== null && !$constructor->isPublic() ) { $this->addTest( new PHPUnit_Framework_Warning( sprintf( 'Class "%s" has no public constructor.', $theClass->getName() ) ) ); return; } $names = array(); /* if ( $theClass->getName() !== 'ezcTestRegressionTest' && !$theClass->isSubclassOf( 'ezcTestRegressionTest' ) ) { $this->addTest( new PHPUnit_Framework_Warning( sprintf( 'Class "%s" is not a subclass of ezcTestRegressionTest.', $theClass->getName() ) ) ); } */ $mainTest = $theClass->newInstance(); $files = $mainTest->getFiles(); foreach ( $files as $fileEntry ) { $this->addRegressionTestFile( $fileEntry['file'], $mainTest ); } $tests = $this->tests(); if ( empty( $tests ) ) { $this->addTest( new PHPUnit_Framework_Warning( sprintf( 'No regression tests found in class "%s".', $theClass->getName() ) ) ); } } public function addRegressionTestFile( $file, $mainTest ) { $test = clone $mainTest; $test->setCurrentFile( $file ); $this->addTest( $test ); } } ?>