public function testExceptionHandlerFiltersOutNull() { $_SERVER['some-item'] = true; // make sure this has at least one thing in it $logSaver = new LogSaver(); $handler = new Handler($logSaver); $handler->server(HandlerFilter::all()); try { $handler->handleException(new \Exception()); } catch (\Exception $e) { // do nothing } $this->assertCount(1, $logSaver->context); $this->assertArrayHasKey('server', $logSaver->context); $this->assertNotEmpty($logSaver->context['server']); }
public function testNoneFilter() { $filter = HandlerFilter::none(); $this->assertTrue(is_callable($filter)); $this->assertNull($filter(['item'])); }