/** * @covers ::execute */ public function testExecute() { $body = ['cols' => ['id', 'name'], 'rows' => [], 'rowcount' => 0, 'duration' => 0]; $response = $this->createResponse(200, $body); $this->internalClient->expects($this->once())->method('post')->will($this->returnValue($response)); $result = $this->client->execute(static::SQL, ['foo' => 'bar']); $this->assertInstanceOf(Collection::class, $result); }
/** * @covers ::execute */ public function testExecute() { $body = ['cols' => ['name'], 'rows' => [['crate2'], ['crate2']], 'rowcount' => 2, 'duration' => 0]; $response = $this->createResponse(200, $body); $this->server->expects($this->once())->method('doRequest')->will($this->returnValue($response)); $result = $this->client->execute('SELECT name FROM sys.nodes', []); $this->assertInstanceOf(Collection::class, $result); }