public function testAncestorKey()
{
$ancestorPath = [['kind' => 'Kind', 'id' => 'ID']];
$ancestor = $this->prophesize(Key::class);
$ancestor->path()->willReturn($ancestorPath);
$ancestor->state()->willReturn(Key::STATE_NAMED);
$key = new Key('foo', ['path' => [['kind' => 'foo']]]);
$key->ancestorKey($ancestor->reveal());
$path = $key->path();
$expected = $ancestorPath;
$expected[] = ['kind' => 'foo'];
$this->assertEquals($path, $expected);
}