Google\Cloud\Tests\Snippets\Datastore\TransactionTest::testUpdateBatch PHP Method

testUpdateBatch() public method

public testUpdateBatch ( )
    public function testUpdateBatch()
    {
        $snippet = $this->snippetFromMethod(Transaction::class, 'updateBatch');
        $snippet->addLocal('datastore', $this->datastore);
        $snippet->addLocal('transaction', $this->transaction);
        $snippet->addLocal('entities', [$this->datastore->entity($this->datastore->key('Person', 'Bob'), [], ['populatedByService' => true]), $this->datastore->entity($this->datastore->key('Person', 'John'), [], ['populatedByService' => true])]);
        $this->connection->commit(Argument::that(function ($args) {
            if ($args['transaction'] !== $this->transactionId) {
                return false;
            }
            if (array_keys($args['mutations'][0])[0] !== 'update') {
                return false;
            }
            return true;
        }))->shouldBeCalled();
        $res = $snippet->invoke();
    }