示例#1
0
文件: UnitTest.php 项目: rsms/phpab
 /** @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();
 }