Exemple #1
0
 public function testRun()
 {
     $this->if($engine = new testedClass())->and($engine->setPhp($php = new \mock\mageekguy\atoum\php()))->then->object($engine->run($test = new \mock\mageekguy\atoum\test()))->isIdenticalTo($engine)->if($test->getMockController()->getCurrentMethod = $method = uniqid())->and($test->getMockController()->getPath = $testPath = uniqid())->and($test->getMockController()->getPhpPath = $phpPath = uniqid())->and($test->getMockController()->codeCoverageIsEnabled = false)->and($test->getMockController()->getBootstrapFile = null)->and($test->setXdebugConfig($xdebugConfig = uniqid()))->and($this->calling($php)->run->throw = $exception = new atoum\php\exception())->and($this->function->getenv = false)->and($this->function->ini_get = 0)->then->exception(function () use($engine, $test) {
         $engine->run($test);
     })->isIdenticalTo($exception)->if($this->calling($php)->run = $php)->then->object($engine->run($test))->isIdenticalTo($engine)->mock($php)->call('run')->withArguments('<?php ' . 'ob_start();' . 'require \'' . atoum\directory . '/classes/autoloader.php\';' . 'require \'' . $testPath . '\';' . '$test = new ' . get_class($test) . '();' . '$test->setLocale(new ' . get_class($test->getLocale()) . '(' . $test->getLocale()->get() . '));' . '$test->setPhpPath(\'' . $phpPath . '\');' . '$test->disableCodeCoverage();' . 'ob_end_clean();' . 'mageekguy\\atoum\\scripts\\runner::disableAutorun();' . 'echo serialize($test->runTestMethod(\'' . $method . '\')->getScore());')->twice()->call('__set')->withArguments('XDEBUG_CONFIG', $xdebugConfig)->twice();
 }