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