public function testLookup()
{
$snippet = $this->snippetFromMethod(Transaction::class, 'lookup');
$snippet->addLocal('datastore', $this->datastore);
$snippet->addLocal('transaction', $this->transaction);
$this->connection->lookup(Argument::that(function ($args) {
if ($args['transaction'] !== $this->transactionId) {
return false;
}
return true;
}))->shouldBeCalled()->willReturn(['found' => [['entity' => ['key' => ['path' => [['kind' => 'Person', 'name' => 'Bob']]], 'properties' => ['firstName' => ['stringValue' => 'Bob']]]]]]);
$this->operation->setConnection($this->connection->reveal());
$res = $snippet->invoke();
$this->assertEquals('Bob', $res->output());
}