Esempio n. 1
0
 public function testStoppedNotice()
 {
     $checks = new ArrayObject(array());
     $check = null;
     $results = new Collection();
     for ($x = 0; $x < 15; $x++) {
         $checks[] = $check = new AlwaysSuccessCheck();
         $results[$check] = new Success();
     }
     ob_start();
     $this->reporter->onStart($checks, array());
     ob_clean();
     $this->reporter->onStop($results);
     $this->reporter->onFinish($results);
     $this->assertStringMatchesFormat('%ADiagnostics aborted%A', trim(ob_get_clean()));
 }
Esempio n. 2
0
 public function testDataDump()
 {
     $this->console->setTestWidth(40);
     $this->reporter->getDisplayData();
     $this->reporter->setDisplayData(true);
     $e = new RunEvent();
     $tests = array(new AlwaysSuccessTest(), new AlwaysSuccessTest());
     $e->setParam('tests', $tests);
     ob_start();
     $this->em->trigger(RunEvent::EVENT_START, $e);
     ob_clean();
     $result = new Success('foo', array('1', 2, 3));
     $e->setTarget($tests[0]);
     $e->setLastResult($result);
     $this->em->trigger(RunEvent::EVENT_AFTER_RUN, $e);
     $this->assertEquals('  OK   Always Successful Test: foo' . PHP_EOL . '       ---------------------------------' . PHP_EOL . '       array (' . PHP_EOL . '         0 => \'1\',' . PHP_EOL . '         1 => 2,' . PHP_EOL . '         2 => 3,' . PHP_EOL . '       )' . PHP_EOL . '       ---------------------------------' . PHP_EOL, ob_get_clean());
     ob_start();
 }