コード例 #1
0
 /**
  * @access protected
  */
 protected function runTest()
 {
     $timer = new Benchmark_Timer();
     $timer->start();
     parent::runTest();
     $timer->stop();
     if ($this->maxRunningTime != 0 && $timer->timeElapsed() > $this->maxRunningTime) {
         $this->fail(sprintf('expected running time: <= %s but was: %s', $this->maxRunningTime, $timer->timeElapsed()));
     }
 }
コード例 #2
0
 /**
  * @access protected
  */
 protected function runTest()
 {
     try {
         parent::runTest();
     } catch (Exception $e) {
         if (is_a($e, $this->expected)) {
             return;
         } else {
             throw $e;
         }
     }
     $this->fail('Expected exception ' . $this->expected);
 }
コード例 #3
0
ファイル: Warning.php プロジェクト: ookwudili/chisimba
 /**
  * @param  string  $message
  * @access public
  */
 public function __construct($message = '')
 {
     $this->message = $message;
     parent::__construct('Warning');
 }
コード例 #4
0
 /**
  * this is run before each test* function in this class, to set
  * up the environment each test runs in.
  */
 public function setUp()
 {
     parent::setUp();
     $this->admin_user_id = $this->factory->user->create(array('role' => 'administrator'));
     wp_set_current_user($this->admin_user_id);
 }
コード例 #5
0
ファイル: Bug9917.php プロジェクト: manishkhanchandani/mkgxy
 public function __construct($name)
 {
     parent::__construct($name);
 }
コード例 #6
0
 /**
  * @access protected
  */
 protected function runTest()
 {
     try {
         parent::runTest();
     } catch (Exception $e) {
         if ($this->expectedException !== NULL && $e instanceof $this->expectedException) {
             return;
         } else {
             throw $e;
         }
     }
     if ($this->expectedException !== NULL) {
         $this->fail('Expected exception ' . $this->expectedException);
     }
 }
コード例 #7
0
 protected function verifySuccess(PHPUnit2_Framework_TestCase $test)
 {
     $result = $test->run();
     $this->assertEquals(0, $result->errorCount());
     $this->assertEquals(0, $result->failureCount());
     $this->assertEquals(1, $result->runCount());
 }