/**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->command = $this->getMockBuilder(ContainerAwareCommand::class)->disableOriginalConstructor()->getMock();
     $this->command->method('getName')->willReturn('babymarktext:test:command');
     $this->output = new BufferedOutput();
     $this->input = new ArrayInput([]);
     $this->reporter = $this->getMockBuilder(CronReport::class)->disableOriginalConstructor()->getMock();
     $this->execution = new Execution();
     $this->reporter->method('logExecution')->willReturn($this->execution);
 }
 /**
  * @param ConsoleTerminateEvent $event
  */
 public function onCronFinished(ConsoleTerminateEvent $event)
 {
     if (!$this->skipped) {
         $this->duration = microtime(true) - $this->start;
         $this->execution = $this->reporter->logExecution($this->alias, $this->duration, $this->startDatetime);
     }
 }
Example #3
0
 public function testClearingStats()
 {
     $this->repository->expects($this->once())->method('deleteByEnvironment')->with($this->equalTo($this->container->getParameter('kernel.environment')));
     $this->report->clearStats();
 }