getMockConnectionOfType('Predis\Connection\CompositeConnectionInterface'); $connection ->expects($this->never()) ->method('readLine'); $connection ->expects($this->never()) ->method('readBuffer'); $handler = new Handler\ErrorResponse(); $response = $handler->handle($connection, $message); $this->assertInstanceOf('Predis\Response\Error', $response); $this->assertSame($message, $response->getMessage()); } }