/**
  * Stop collecting at the end of a request
  *
  * @param \Symfony\Component\HttpKernel\Event\PostResponseEvent $event
  */
 public function onKernelTerminate(PostResponseEvent $event)
 {
     if (!$this->driver || !$this->repository->isEnabled()) {
         return;
     }
     $coverage = $this->driver->stop();
     $this->repository->addCoverage($coverage);
 }
 /**
  * Stop code coverage
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function deleteAction()
 {
     $this->repository->drop();
     return new Response();
 }
 public function testDropWhenFileMissing()
 {
     $proxy = $this->getMock('VIPSoft\\Test\\FunctionProxy');
     $proxy->expects($this->never())->method('invokeFunction');
     $this->getMockFunction('unlink', $proxy);
     $repository = new CodeCoverageRepository($this->databaseConfig, $this->databaseDirectory, $this->sqlite);
     $repository->drop();
 }