Google\Cloud\Tests\Snippets\Datastore\DatastoreClientTest::testRunQuery PHP Method

testRunQuery() public method

public testRunQuery ( )
    public function testRunQuery()
    {
        $snippet = $this->snippetFromMethod(DatastoreClient::class, 'runQuery');
        $snippet->addLocal('datastore', $this->client);
        $snippet->addLocal('query', $this->prophesize(QueryInterface::class)->reveal());
        $this->connection->runQuery(Argument::any())->shouldBeCalled()->willReturn(['batch' => ['entityResults' => [['entity' => ['key' => ['path' => [['kind' => 'Person', 'name' => 'Bob']]], 'properties' => ['firstName' => ['stringValue' => 'Bob']]]]]]]);
        $this->client->setConnection($this->connection->reveal());
        $res = $snippet->invoke('result');
        $this->assertEquals('Bob', $res->output());
    }