public function testInsertBatch()
{
$snippet = $this->snippetFromMethod(Transaction::class, 'insertBatch');
$snippet->addLocal('datastore', $this->datastore);
$snippet->addLocal('transaction', $this->transaction);
$this->connection->commit(Argument::that(function ($args) {
if ($args['transaction'] !== $this->transactionId) {
return false;
}
if (array_keys($args['mutations'][0])[0] !== 'insert') {
return false;
}
return true;
}))->shouldBeCalled()->willReturn(['mutationResults' => [['version' => 1]]]);
$this->allocateIdsConnectionMock();
$this->operation->setConnection($this->connection->reveal());
$res = $snippet->invoke();
}