コード例 #1
0
ファイル: xunit.php プロジェクト: xihewang/atoum
 public function testHandleEvent()
 {
     $this->if($adapter = new atoum\test\adapter())->and($adapter->extension_loaded = true)->and($report = new reports\xunit($adapter))->then->variable($report->getTitle())->isNull()->castToString($report)->isEmpty()->string($report->handleEvent(atoum\runner::runStop, new atoum\runner())->getTitle())->isEqualTo(atoum\reports\asynchronous\xunit::defaultTitle)->castToString($report)->isNotEmpty()->if($report = new reports\xunit($adapter))->then->string($report->setTitle($title = uniqid())->handleEvent(atoum\runner::runStop, new atoum\runner())->getTitle())->isEqualTo($title)->if($report = new reports\xunit($adapter))->and($writer = new \mock\mageekguy\atoum\writers\file())->and($writer->getMockController()->write = $writer)->then->when(function () use($report, $writer) {
         $report->addWriter($writer)->handleEvent(atoum\runner::runStop, new \mageekguy\atoum\runner());
     })->mock($writer)->call('writeAsynchronousReport')->withArguments($report)->once();
 }