public function testSetLastElementIdentifier()
{
$ds = $this->prophesize(DatastoreClient::class);
$ds->key(Argument::any(), Argument::any())->will(function ($args) {
return new Key('my-awesome-project', ['path' => [['kind' => $args[0]]]]);
});
$snippet = $this->snippetFromMethod(Key::class, 'setLastElementIdentifier');
$snippet->addLocal('datastore', $ds->reveal());
$snippet->addUse(Key::class);
$res = $snippet->invoke('key');
$this->assertEquals(Key::STATE_NAMED, $res->returnVal()->state());
}