Google\Cloud\Tests\Datastore\EntityMapperTest::testConvertValueEntityWithIncompleteKey PHP Method

testConvertValueEntityWithIncompleteKey() public method

    public function testConvertValueEntityWithIncompleteKey()
    {
        $type = 'entityValue';
        $val = ['key' => ['partitionId' => ['namespaceId' => 'bar'], 'path' => [['kind' => 'kind']]], 'properties' => ['prop' => ['stringValue' => 'test']]];
        $res = $this->mapper->convertValue($type, $val);
        $this->assertInstanceOf(Entity::class, $res);
        $this->assertInstanceOf(Key::class, $res->key());
        $key = $res->key()->keyObject();
        $this->assertEquals('bar', $key['partitionId']['namespaceId']);
        $this->assertEquals([['kind' => 'kind']], $key['path']);
        $this->assertEquals('test', $res['prop']);
    }