Example #1
0
 public function setUp()
 {
     $this->logger = new Logger('phpunit-logger');
     $directoryLogOutput = self::$directoryV->url() . '/log';
     if (!file_exists($directoryLogOutput)) {
         mkdir($directoryLogOutput, 0700, true);
     }
     $output = "%level_name% > %message% %context% %extra%\n";
     $formatter = new LineFormatter($output);
     $handler = new StreamHandler($directoryLogOutput . '/phpunit.log', Logger::DEBUG, true, null, false);
     touch($directoryLogOutput . '/phpunit.log');
     $handler->setFormatter($formatter);
     $this->logger->pushHandler($handler);
     $this->logger->info('Avviato test -> ' . $this->getName());
 }