Exemplo n.º 1
0
 public function testOnErrorWhenExceptionLoggingIsDisabledShouldNotLogException()
 {
     $client = $this->createMock(ClientInterface::class);
     $options = new ModuleOptions(['exceptions_logging_enabled' => false]);
     $psrLogger = $this->createMock(LoggerInterface::class);
     $listener = new ErrorListener($client, $options, $psrLogger);
     $psrLogger->expects($this->never())->method('error');
     $listener->onError($this->createMvcEventWithException());
 }
Exemplo n.º 2
0
 public function testEventHandlerNotCallLogger()
 {
     $this->moduleOptions = new ModuleOptions();
     $this->listener->setModuleOptions($this->moduleOptions);
     $this->moduleOptions->setExceptionsLoggingEnabled(false);
     $mvcEvent = new MvcEvent();
     $exception = new Exception('a message');
     $mvcEvent->setParam('exception', $exception);
     $this->listener->onError($mvcEvent);
     $this->assertCount(0, $this->writer->events);
 }