コード例 #1
0
ファイル: errors.php プロジェクト: pombredanne/tuleap
 /**
  *    Invokes a test method and dispatches any
  *    untrapped errors. Called back from
  *    the visiting runner.
  *    @param string $method    Test method to call.
  *    @access public
  */
 function invoke($method)
 {
     $queue =& $this->_createErrorQueue();
     set_error_handler('SimpleTestErrorHandler', (E_ALL | E_STRICT) & ~E_RECOVERABLE_ERROR);
     parent::invoke($method);
     restore_error_handler();
     $queue->tally();
 }
コード例 #2
0
ファイル: errors.php プロジェクト: kapai69/fl-ru-damp
 /**
  *    Invokes a test method and dispatches any
  *    untrapped errors. Called back from
  *    the visiting runner.
  *
  *    @param string $method    Test method to call.
  */
 public function invoke($method)
 {
     $queue =& $this->_createErrorQueue();
     set_error_handler('SimpleTestErrorHandler');
     parent::invoke($method);
     restore_error_handler();
     $queue->tally();
 }
コード例 #3
0
 /**
  *    Invokes a test method and dispatches any
  *    untrapped errors.
  *    @param string $method    Test method to call.
  *    @access public
  */
 function invoke($method)
 {
     try {
         parent::invoke($method);
     } catch (Exception $exception) {
         $test_case =& $this->getTestCase();
         $test_case->exception($exception);
     }
 }
コード例 #4
0
 function invoke($method)
 {
     set_error_handler('simpleTestErrorHandler');
     parent::invoke($method);
     $queue =& SimpleErrorQueue::instance();
     while (list($severity, $message, $file, $line, $globals) = $queue->extract()) {
         $test_case =& $this->getTestCase();
         $test_case->error($severity, $message, $file, $line, $globals);
     }
     restore_error_handler();
 }
コード例 #5
0
ファイル: exceptions.php プロジェクト: veritech/pare-project
 /**
  *    Invokes a test method and dispatches any
  *    untrapped errors.
  *    @param string $method    Test method to call.
  *    @access public
  */
 function invoke($method)
 {
     try {
         parent::invoke($method);
     } catch (Exception $exception) {
         $test_case =& $this->getTestCase();
         $test_case->tearDown();
         // Added by T.J.Hunt@open.ac.uk.
         $test_case->exception($exception);
     }
 }
コード例 #6
0
ファイル: eclipse.php プロジェクト: JackCanada/moodle-hacks
 function invoke($method)
 {
     ob_start();
     parent::invoke($method);
     $output = ob_get_contents();
     ob_end_clean();
     $sock = new SimpleSocket("127.0.0.1", $this->_port, 5);
     $sock->write($output);
     $sock->close();
     echo $sock->getError();
 }
コード例 #7
0
ファイル: errors.php プロジェクト: JackCanada/moodle-hacks
 /**
  *    Invokes a test method and dispatches any
  *    untrapped errors. Called back from
  *    the visiting runner.
  *    @param string $method    Test method to call.
  *    @access public
  */
 function invoke($method)
 {
     $context =& SimpleTest::getContext();
     $queue =& $context->get('SimpleErrorQueue');
     $queue->setTestCase($this->GetTestCase());
     set_error_handler('SimpleTestErrorHandler');
     parent::invoke($method);
     while (list($severity, $message, $file, $line) = $queue->extract()) {
         $severity = SimpleErrorQueue::getSeverityAsString($severity);
         $test =& $this->getTestCase();
         $test->error($severity, $message, $file, $line);
     }
     restore_error_handler();
 }
コード例 #8
0
ファイル: exceptions.php プロジェクト: hafizubikm/bakeme
 /**
  *    Invokes a test method whilst trapping expected
  *    exceptions. Any left over unthrown exceptions
  *    are then reported as failures.
  *    @param string $method    Test method to call.
  */
 function invoke($method)
 {
     $trap = SimpleTest::getContext()->get('SimpleExceptionTrap');
     $trap->clear();
     try {
         parent::invoke($method);
     } catch (Exception $exception) {
         if (!$trap->isExpected($this->getTestCase(), $exception)) {
             $this->getTestCase()->exception($exception);
         }
         $trap->clear();
     }
     if ($message = $trap->getOutstanding()) {
         $this->getTestCase()->fail($message);
     }
 }
コード例 #9
0
ファイル: errors.php プロジェクト: vuchannguyen/web
 /**
  *    Invokes a test method and dispatches any
  *    untrapped errors. Called back from
  *    the visiting runner.
  *    @param string $method    Test method to call.
  *    @access public
  */
 function invoke($method)
 {
     $queue =& $this->_createErrorQueue();
     set_error_handler('SimpleTestErrorHandler');
     //moodle hack start
     // note: this breaks PHP4 compatibility!
     $rethrow = null;
     try {
         parent::invoke($method);
     } catch (Exception $e) {
         $rethrow = $e;
     }
     restore_error_handler();
     $queue->tally();
     if ($rethrow) {
         throw $rethrow;
     }
     //moodle hack end
 }
コード例 #10
0
ファイル: exceptions.php プロジェクト: kapai69/fl-ru-damp
 /**
  *    Invokes a test method whilst trapping expected
  *    exceptions. Any left over unthrown exceptions
  *    are then reported as failures.
  *
  *    @param string $method    Test method to call.
  */
 public function invoke($method)
 {
     $trap = SimpleTest::getContext()->get('SimpleExceptionTrap');
     $trap->clear();
     try {
         $has_thrown = false;
         parent::invoke($method);
     } catch (Exception $exception) {
         $has_thrown = true;
         if (!$trap->isExpected($this->getTestCase(), $exception)) {
             $this->getTestCase()->exception($exception);
         }
         $trap->clear();
     }
     if ($message = $trap->getOutstanding()) {
         $this->getTestCase()->fail($message);
     }
     if ($has_thrown) {
         try {
             parent::getTestCase()->tearDown();
         } catch (Exception $e) {
         }
     }
 }
コード例 #11
0
ファイル: fails.php プロジェクト: GerHobbelt/simpletest
 /**
  *    Invokes a test method and dispatches any
  *    untrapped assertion failures. Called back from
  *    the visiting runner.
  *    @param string $method    Test method to call.
  *    @access public
  */
 function invoke($method)
 {
     $queue = $this->createFailQueue();
     parent::invoke($method);
     $queue->tally();
 }
コード例 #12
0
 /**
  *    Builds the browser and runs the test.
  *    @param string $method    Test method to call.
  *    @access public
  */
 function invoke($method)
 {
     $test =& $this->getTestCase();
     $test->setBrowser($test->createBrowser());
     parent::invoke($method);
     $test->unsetBrowser();
 }
コード例 #13
0
ファイル: eclipse.php プロジェクト: triasfahrudin/siska21
 function __construct(&$invoker, &$listener)
 {
     $this->_listener =& $listener;
     parent::__construct($invoker);
 }
コード例 #14
0
ファイル: eclipse.php プロジェクト: GerHobbelt/simpletest
 function __construct($invoker, $listener)
 {
     parent::__construct($invoker);
     $this->listener = $listener;
 }
コード例 #15
0
ファイル: test_list.php プロジェクト: GerHobbelt/simpletest
 /**
  *    Set up the ListTestInvoker.
  *    @param SimpleInvoker $invoker      Chained test method runner.
  *    @access public
  */
 function __construct($invoker)
 {
     parent::__construct($invoker);
 }