public function testAllocateIdsToEntities()
{
$this->connection->allocateIds(Argument::that(function ($arg) {
if (count($arg['keys']) !== 1) {
return false;
}
return true;
}))->shouldBeCalled()->willReturn(['keys' => [['path' => [['kind' => 'foo', 'id' => '1']]]]]);
$this->operation->setConnection($this->connection->reveal());
$entities = [$this->operation->entity($this->operation->key('Foo', 'Bar')), $this->operation->entity($this->operation->key('Foo'))];
$res = $this->operation->allocateIdsToEntities($entities);
$this->assertInstanceOf(Entity::class, $res[0]);
$this->assertInstanceOf(Entity::class, $res[1]);
$this->assertEquals($res[0]->key()->state(), Key::STATE_NAMED);
$this->assertEquals($res[1]->key()->state(), Key::STATE_NAMED);
}