public function useConfigFile($path) { $script = call_user_func($this->configuratorFactory, $this); $runner = $this->runner; return $this->includeConfigFile($path, function ($path) use($script, $runner) { include_once $path; }); }
public function testUseConfigFile() { $this->if($runner = new testedClass(uniqid()))->and($runner->setLocale($locale = new \mock\mageekguy\atoum\locale()))->then->exception(function () use($runner, &$file) { $runner->useConfigFile($file = uniqid()); })->isInstanceOf('mageekguy\\atoum\\includer\\exception')->hasMessage('Unable to find configuration file \'' . $file . '\'')->mock($locale)->call('_')->withArguments('Unable to find configuration file \'%s\'')->once()->if($configFile = stream::get())->and($configFile->file_get_contents = '<?php $runner->disableCodeCoverage(); ?>')->then->boolean($runner->getRunner()->codeCoverageIsEnabled())->isTrue()->object($runner->useConfigFile((string) $configFile))->isIdenticalTo($runner)->boolean($runner->getRunner()->codeCoverageIsEnabled())->isFalse(); }