public function testcritical() { $exception = new \Exception('error message'); $expected = "%aEXCEPTION%a'Exception'%a'error message'%a"; $this->stream->expects($this->once())->method('write')->with($this->matches($expected)); $this->object->critical($exception); }