public function testAllocateId()
{
$snippet = $this->snippetFromMethod(DatastoreClient::class, 'allocateId');
$snippet->addLocal('datastore', $this->client);
$this->allocateIdsConnectionMock();
$this->client->setConnection($this->allocateIdsConnectionMock());
$res = $snippet->invoke('keyWithAllocatedId');
$this->assertInstanceOf(Key::class, $res->returnVal());
$this->assertEquals(Key::STATE_NAMED, $res->returnVal()->state());
}