public static function registerDeletion(Repository $repository) { register_shutdown_function(function () use($repository) { if ($repository->getWorkingDir()) { $dir = $repository->getWorkingDir(); } else { $dir = $repository->getGitDir(); } AbstractTest::deleteDir($dir); }); }
/** * Injects Logger inside the repository. */ public function addRepository(Repository $repository) { if (null !== $repository->getLogger()) { throw new \RuntimeException('A logger is already injected in repository.'); } $name = $repository->getGitDir(); $logger = new Logger($name); $handler = new TestHandler(); $logger->pushHandler($handler); $this->handlers[$name] = $handler; $repository->setLogger($logger); }