Google\Cloud\Tests\Datastore\OperationTest::testAllocateIds PHP Method

testAllocateIds() public method

public testAllocateIds ( )
    public function testAllocateIds()
    {
        $keys = [$this->operation->key('foo')];
        $this->connection->allocateIds(Argument::type('array'))->shouldBeCalled()->willReturn(['keys' => [['path' => [['kind' => 'foo', 'id' => '1']]]]]);
        $this->operation->setConnection($this->connection->reveal());
        $res = $this->operation->allocateIds($keys);
        $this->assertEquals($res[0]->state(), Key::STATE_NAMED);
        $this->assertEquals($res[0]->path()[0]['id'], '1');
    }