Ejemplo n.º 1
0
    public function run(DoctrineTest_Reporter $reporter = null, $filter = null)
    {
        $reporter->paintHeader($this->_title);
        foreach ($this->_testCases as $k => $testCase) {
            if ( ! $this->shouldBeRun($testCase, $filter)) {
                continue;
            }
            try{
                $testCase->run();
            } catch(Exception $e) {
                $this->_failed += 1;
                $this->_messages[] = 'Unexpected exception thrown in [' . get_class($testCase) . '] with message [' . $e->getMessage() . '] in ' . $e->getFile() . ' on line ' . $e->getLine() . "\n\nTrace\n-------------\n\n" . $e->getTraceAsString();;
                
            }
            $this->_passed += $testCase->getPassCount();
            $this->_failed += $testCase->getFailCount();
            $this->_messages = array_merge($this->_messages, $testCase->getMessages());

            $this->_testCases[$k] = null;
            echo $reporter->getProgressIndicator();
            set_time_limit(900);
        }
        $reporter->setTestCase($this);
        
        $this->cachePassesAndFails();

        $reporter->paintFooter();
    }
Ejemplo n.º 2
0
 public function run(DoctrineTest_Reporter $reporter = null, $filter = null)
 {
     set_time_limit(900);
     $reporter->setTestCase($this);
     $reporter->paintHeader($this->_title);
     foreach ($this->_testCases as $k => $testCase) {
         $reporter->setTestCase($testCase);
         if (!$this->shouldBeRun($testCase, $filter)) {
             continue;
         }
         try {
             $testCase->run();
         } catch (Exception $e) {
             $this->_failed += 1;
             $message = 'Unexpected ' . get_class($e) . ' thrown in [' . get_class($testCase) . '] with message [' . $e->getMessage() . '] in ' . $e->getFile() . ' on line ' . $e->getLine() . "\n\nTrace\n-------------\n\n" . $e->getTraceAsString();
             $testCase->addMessage($message);
         }
         $this->_passed += $testCase->getPassCount();
         $this->_failed += $testCase->getFailCount();
         $this->_testCases[$k] = null;
         $reporter->paintMessages();
     }
     $reporter->setTestCase($this);
     $reporter->paintMessages();
     $this->cachePassesAndFails();
     $reporter->paintFooter();
     return $this->_failed ? false : true;
 }
Ejemplo n.º 3
0
 public function paintMessages()
 {
     parent::paintMessages();
 }