/** @return UnitTest */ public static function instance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; }
/** * Run tests * * @return void */ public function test() { # Refresh assert bindings UnitTest::instance()->refreshAssertBindings(); # Reset case storage & passed-cache $this->cases = array(); $this->allCasesPassed = true; # Implementation-specific test logic $this->performTests(); }
/** * Run tests * * @return void */ public function test() { $oldAssertionStorage =& UnitTest::instance()->getAssertionStorage(); UnitTest::instance()->setAssertionStorage($this->assertions); try { $this->performTests(); } catch (Exception $e) { $this->exception = $e; } UnitTest::instance()->setAssertionStorage($oldAssertionStorage); $this->updateAssertions(); }