public function testUpsertBatch()
{
$snippet = $this->snippetFromMethod(Transaction::class, 'upsertBatch');
$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] !== 'upsert') {
return false;
}
return true;
}))->shouldBeCalled();
$res = $snippet->invoke();
}