Ejemplo n.º 1
0
 public function testWriteAsynchronousReport()
 {
     $this->if($adapter = new atoum\test\adapter())->and($adapter->file_get_contents = '')->and($report = new \mock\mageekguy\atoum\reports\asynchronous())->and($writer = new \mock\mageekguy\atoum\writers\http($adapter))->and($writer->setUrl(uniqid()))->then->object($writer->writeAsynchronousReport($report))->isIdenticalTo($writer)->mock($writer)->call('write')->withArguments($report->__toString())->once();
 }
Ejemplo n.º 2
0
 public function testWriteAsynchronousReport()
 {
     $this->if($adapter = new atoum\test\adapter())->and($adapter->file_get_contents = '')->and($report = new \mock\mageekguy\atoum\reports\asynchronous())->and($writer = new \mock\mageekguy\atoum\writers\http($adapter))->and($writer->setUrl($url = uniqid()))->then->object($writer->writeAsynchronousReport($report))->isIdenticalTo($writer)->mock($writer)->call('write')->withArguments($report->__toString())->once()->if($adapter->file_get_contents = false)->then->exception(function () use($writer, $report) {
         $writer->writeAsynchronousReport($report);
     })->isInstanceOf('mageekguy\\atoum\\writers\\http\\exception')->hasMessage('Unable to write coverage report to ' . $url);
 }