Google\Cloud\Tests\Datastore\DatastoreClientTest::testInsertConflict PHP Method

testInsertConflict() public method

public testInsertConflict ( )
    public function testInsertConflict()
    {
        $e = $this->prophesize(Entity::class);
        $this->operation->allocateIdsToEntities(Argument::type('array'))->willReturn([$e->reveal()]);
        $this->operation->mutation(Argument::exact('insert'), Argument::type(Entity::class), Argument::exact(Entity::class), Argument::exact(null))->shouldBeCalled();
        $this->operation->commit(Argument::type('array'), Argument::type('array'))->shouldBeCalled()->willReturn(['mutationResults' => [['version' => '1234', 'conflictDetected' => true]]]);
        $this->datastore->setOperation($this->operation->reveal());
        $res = $this->datastore->insert($e->reveal());
    }