示例#1
0
    function it_should_process_global_section(ContainerInterface $container, PhpGuard $guard)
    {
        $guard->setOptions(array('ignores' => 'app/cache'))->shouldBeCalled();
        $text = <<<EOF
phpguard:
    ignores: app/cache
EOF;
        $this->compile($text);
    }
示例#2
0
 private function configureErrorHandler()
 {
     $file = PhpGuard::getPluginCache('phpunit') . '/error.log';
     if (is_file($file)) {
         @unlink($file);
     }
     touch($file);
     $this->errorFile = $file;
     ini_set('display_errors', 1);
     ini_set('error_log', $file);
     register_shutdown_function(array($this, 'handleShutdown'));
 }
示例#3
0
 private function configureErrorHandler()
 {
     $errorFile = PhpGuard::getPluginCache('phpspec') . '/error.log';
     // @codeCoverageIgnoreStart
     if (file_exists($errorFile)) {
         unlink($errorFile);
     }
     // @codeCoverageIgnoreEnd
     touch($errorFile);
     ini_set('display_errors', 1);
     ini_set('error_log', $errorFile);
     $this->errorFile = $errorFile;
     register_shutdown_function(array($this, 'handleShutdown'));
 }
示例#4
0
 public function generateRerunFile()
 {
     $dir = PhpGuard::getPluginCache('behat');
     $rerunFile = $dir . '/rerun.dat';
     // clean up unexisting result
     $this->cleanup();
     $rerun = array();
     foreach ($this->results as $result) {
         if (!in_array($file = $result->getFile(), $rerun)) {
             $rerun[] = $file;
         }
     }
     $content = implode("\n", $rerun);
     $this->fs->putFileContents($rerunFile, $content);
     return $rerunFile;
 }
示例#5
0
 public static function getCacheFileName()
 {
     $dir = PhpGuard::getPluginCache('phpspec');
     return $dir . DIRECTORY_SEPARATOR . 'results.dat';
 }
示例#6
0
 public static function getRerunFileName()
 {
     $dir = PhpGuard::getPluginCache('behat');
     $file = $dir . DIRECTORY_SEPARATOR . 'rerun.dat';
     return $file;
 }
示例#7
0
 protected function setUp()
 {
     parent::setUp();
     $file = PhpGuard::getPluginCache('phpunit') . '/result_test.dat';
     static::$container->setParameter('phpunit.inspector_cache', $file);
 }
示例#8
0
 public static function getCacheFile()
 {
     $dir = PhpGuard::getCacheDir();
     if (!is_dir($dir)) {
         mkdir($dir, 0775, true);
     }
     return $dir . '/coverage_session.dat';
 }
示例#9
0
 public function testGetPlugincache()
 {
     $cacheDir = PhpGuard::getCacheDir();
     PhpGuard::getPluginCache('foo');
     $this->assertTrue(is_dir($cacheDir . '/plugins/foo'));
 }
示例#10
0
 public function setupContainer(ContainerInterface $container)
 {
     $container->set('ui.application', $this);
     $container->setShared('ui.shell', function ($c) {
         $shell = new Shell($c);
         return $shell;
     });
     $phpGuard = new PhpGuard();
     $phpGuard->setContainer($container);
     $phpGuard->setupServices($container);
     $phpGuard->setupCommands($container);
     $phpGuard->setupListeners($container);
     $container->set('phpguard', $phpGuard);
     $this->setDispatcher($container->get('dispatcher'));
     $this->container = $container;
 }
示例#11
0
 public static function getResultFileName()
 {
     $dir = PhpGuard::getPluginCache('phpunit');
     return $dir . '/results.dat';
 }