Google\Cloud\Tests\Datastore\OperationTest::testLookupDeferred PHP Method

testLookupDeferred() public method

public testLookupDeferred ( )
    public function testLookupDeferred()
    {
        $body = json_decode(file_get_contents(__DIR__ . '/../fixtures/datastore/entity-batch-lookup.json'), true);
        $this->connection->lookup(Argument::any())->willReturn(['deferred' => [$body[0]['entity']['key']]]);
        $this->operation->setConnection($this->connection->reveal());
        $key = $this->operation->key('Kind', 'ID');
        $res = $this->operation->lookup([$key]);
        $this->assertTrue(is_array($res));
        $this->assertTrue(isset($res['deferred']) && is_array($res['deferred']));
        $this->assertInstanceOf(Key::class, $res['deferred'][0]);
    }