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

testLookup() public method

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