public function testStatementMethod() { // Mock actions $this->connection->shouldReceive('createErrors')->once()->andReturn($this->errors); $this->request->shouldReceive('setResponse')->once()->andReturn($this->request); $this->connection->shouldReceive('createStatement')->once()->andReturn($this->statement); $this->connection->shouldReceive('createRequest')->once()->andReturn($this->request); $this->request->shouldReceive('pushStatement')->once()->andReturn($this->request); $this->request->shouldReceive('execute')->once(); $this->statement->shouldReceive('getResult')->once()->andReturn($this->result); // Test start here $response = new Response($this->connection, $this->request, $this->responseArray); $result = $response->statement('match n return n'); $this->assertInstanceOf('EndyJasmi\\Neo4j\\Response\\ResultInterface', $result); }