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

testCommit() public method

public testCommit ( )
    public function testCommit()
    {
        $this->connection->commit(Argument::that(function ($arg) {
            if ($arg['mode'] !== 'NON_TRANSACTIONAL') {
                return false;
            }
            if (count($arg['mutations']) > 0) {
                return false;
            }
            return true;
        }))->shouldBeCalled()->willReturn(['foo']);
        $this->operation->setConnection($this->connection->reveal());
        $this->assertEquals(['foo'], $this->operation->commit([]));
    }