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

testLookupWithSort() public method

public testLookupWithSort ( )
    public function testLookupWithSort()
    {
        $data = json_decode(file_get_contents(__DIR__ . '/../fixtures/datastore/entity-lookup-bigsort.json'), true);
        $keys = [];
        foreach ($data['keys'] as $key) {
            $keys[] = new Key('test-project', ['path' => $key['path']]);
        }
        $this->connection->lookup(Argument::any())->willReturn(['found' => $data['entities']]);
        $this->operation->setConnection($this->connection->reveal());
        $res = $this->operation->lookup($keys, ['sort' => true]);
        $found = $res['found'];
        foreach ($data['keys'] as $i => $key) {
            $this->assertEquals($key['path'][0]['id'], $found[$i]->key()->path()[0]['id']);
        }
    }