getMethods( \ReflectionMethod::IS_PUBLIC ) as $method ) { // Skip methods inherited from parent class if ( $method->class != $class->getName() ) continue; if ( in_array( $method->name, $skip ) ) continue; $classname = str_replace( $class->getParentClass()->getName().'_', '', $method->class ); printtext( "\n\t" . $classname."->".$method->name." [".$method->class."->".$method->name."]" . " \n\t" ); $call = $method->name; $this->$call(); try { R::nuke(); } catch( \PDOException $e ) { // Some tests use a broken database on purpose, so an exception is ok } } } /** * Clean-up method, to be invoked after running the test. * This is an empty implementation, it does nothing. However this method * should be overridden by tests that require clean-up. * * @return void */ public function cleanUp() { } /** * Sets the current driver. * This method is called by a test controller, runner or manager * to activate the mode associated with the specified driver * identifier. This mechanism allows a test to run slightly different * in the context of another driver, for instance SQLite might not need * some tests, or MySQL might need some additional tests etc... * * @param string $driver the driver identifier * * @return void */ public function setCurrentDriver( $driver ) { $this->currentlyActiveDriverID = $driver; } /** * Sets the round number. * Each test can have a varying number of flavors. * A test flavor is 'that same test' but for a different driver. * Each 'run on a specific driver' is called a round. * Some tests might want to know what the current round is. * This method can be used to set the current round number. * * @param integer $roundNumber round, the current round number * * @return void */ public function setRound( $roundNumber ) { $this->round = (int) $roundNumber; } /** * Returns the current round number. * The current round number indicates how many times * this test has been applied (to various drivers). * * @return integer */ public function getRound() { return $this->round; } /** * Detects whether the current round is the first one. * If the current round is indeed the first round, this method * will return boolean TRUE, otherwise it will return FALSE. Note that * the rounds are 0-based, so - if the current round equals 0, this * method will return TRUE. * * @return boolean */ public function isFirstRound() { return ( $this->round === 0 ); } }