Google\Cloud\Tests\Snippets\Datastore\DatastoreClientTest::testAllocateIdsBatch PHP Method

testAllocateIdsBatch() public method

    public function testAllocateIdsBatch()
    {
        $snippet = $this->snippetFromMethod(DatastoreClient::class, 'allocateIds');
        $snippet->addLocal('datastore', $this->client);
        $this->allocateIdsConnectionMock();
        $this->client->setConnection($this->allocateIdsConnectionMock());
        $res = $snippet->invoke('keysWithAllocatedIds');
        $this->assertInstanceOf(Key::class, $res->returnVal()[0]);
        $this->assertInstanceOf(Key::class, $res->returnVal()[1]);
        $this->assertEquals(Key::STATE_NAMED, $res->returnVal()[0]->state());
    }