示例#1
0
 public function testDataDump()
 {
     $this->console->setTestWidth(40);
     $this->reporter->getDisplayData();
     $this->reporter->setDisplayData(true);
     $checks = new ArrayObject(array(new AlwaysSuccessCheck(), new AlwaysSuccessCheck()));
     ob_start();
     $this->reporter->onStart($checks, array());
     ob_clean();
     $result = new Success('foo', array('1', 2, 3));
     $this->reporter->onAfterRun($checks[0], $result);
     $this->assertEquals('  OK   Always Successful Check: 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();
 }
示例#2
0
 public function testProgressOverflowMatch()
 {
     $this->console->setTestWidth(40);
     $checks = new ArrayObject(array_fill(0, 75, new AlwaysSuccessCheck()));
     ob_start();
     $this->reporter->onStart($checks, array());
     ob_get_clean();
     ob_start();
     foreach ($checks as $check) {
         $result = new Success();
         $this->reporter->onAfterRun($check, $result);
     }
     $expected = '......................... 25 / 75 ( 33%)';
     $expected .= '......................... 50 / 75 ( 67%)';
     $expected .= '......................... 75 / 75 (100%)';
     $this->assertEquals($expected, ob_get_clean());
 }
示例#3
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();
 }
示例#4
0
 public function testProgressOverflowMatch()
 {
     $e = new RunEvent();
     $this->console->setTestWidth(40);
     $tests = array_fill(0, 75, new AlwaysSuccessTest());
     $e->setParam('tests', $tests);
     ob_start();
     $this->em->trigger(RunEvent::EVENT_START, $e);
     ob_get_clean();
     ob_start();
     foreach ($tests as $test) {
         $result = new Success();
         $e->setTarget($test);
         $e->setLastResult($result);
         $this->em->trigger(RunEvent::EVENT_AFTER_RUN, $e);
     }
     $expected = '......................... 25 / 75 ( 33%)';
     $expected .= '......................... 50 / 75 ( 67%)';
     $expected .= '......................... 75 / 75 (100%)';
     $this->assertEquals($expected, ob_get_clean());
 }