Google\Cloud\Tests\Datastore\DatastoreClientTest::testKeysAncestors PHP Method

testKeysAncestors() public method

public testKeysAncestors ( )
    public function testKeysAncestors()
    {
        $ancestors = [['kind' => 'Parent1', 'id' => '123'], ['kind' => 'Parent2', 'id' => '321']];
        $keys = $this->datastore->keys('Person', ['allocateIds' => false, 'ancestors' => $ancestors]);
        $key = $keys[0];
        $keyAncestors = $key->keyObject()['path'];
        array_pop($keyAncestors);
        $this->assertEquals($keyAncestors, $ancestors);
    }