Example #1
0
 public function testAfterRunStopTesting()
 {
     $check1 = new AlwaysSuccess();
     $check2 = new AlwaysSuccess();
     $this->runner->addCheck($check1);
     $this->runner->addCheck($check2);
     $mock = $this->getMock('ZendDiagnosticsTest\\TestAsset\\Reporter\\AbstractReporter', array('onAfterRun'));
     $mock->expects($this->atLeastOnce())->method('onAfterRun')->with($this->isInstanceOf('ZendDiagnostics\\Check\\CheckInterface'))->will($this->onConsecutiveCalls(false, true));
     $this->runner->addReporter($mock);
     $results = $this->runner->run();
     $this->assertInstanceOf('ZendDiagnostics\\Result\\Collection', $results);
     $this->assertEquals(1, $results->count());
     $this->assertFalse($results->offsetExists($check2));
     $this->assertInstanceOf('ZendDiagnostics\\Result\\SuccessInterface', $results->offsetGet($check1));
 }