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

testLookupMissing() public method

public testLookupMissing ( )
    public function testLookupMissing()
    {
        $body = json_decode(file_get_contents(__DIR__ . '/../fixtures/datastore/entity-batch-lookup.json'), true);
        $this->connection->lookup(Argument::any())->willReturn(['missing' => $body]);
        $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['missing']) && is_array($res['missing']));
        $this->assertInstanceOf(Key::class, $res['missing'][0]);
        $this->assertInstanceOf(Key::class, $res['missing'][1]);
    }