Пример #1
0
 /** @return UnitTest */
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Пример #2
0
 /**
  * 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();
 }
Пример #3
0
 /**
  * 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();
 }