public function testUpsert()
{
$snippet = $this->snippetFromMethod(DatastoreClient::class, 'upsert');
$snippet->addLocal('datastore', $this->client);
$this->connection->commit(Argument::that(function ($args) {
if (array_keys($args['mutations'][0])[0] !== 'upsert') {
return false;
}
return true;
}))->shouldBeCalled()->willReturn(['mutationResults' => [['version' => 1]]]);
$this->client->setConnection($this->connection->reveal());
$res = $snippet->invoke();
}