Пример #1
0
 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();
 }
<?php

use mageekguy\atoum;
$cloverWriter = new atoum\writers\file(__DIR__ . '/build/atoum.clover.xml');
$cloverReport = new atoum\reports\asynchronous\clover();
$cloverReport->addWriter($cloverWriter);
$xunitWriter = new atoum\writers\file(__DIR__ . '/build/atoum.xunit.xml');
$xunitReport = new atoum\reports\asynchronous\xunit();
$xunitReport->addWriter($xunitWriter);
$runner->addReport($script->addDefaultReport());
$runner->addReport($cloverReport);
$runner->addReport($xunitReport);