public function testBeginRecognizeOperationWithOptions()
{
$snippet = $this->snippetFromMethod(SpeechClient::class, 'beginRecognizeOperation', 1);
$snippet->addLocal('speech', $this->client);
$snippet->replace('__DIR__ . \'/audio.flac\'', $this->testFile);
$this->connection->asyncRecognize(Argument::any())->shouldBeCalled()->willReturn(['done' => false, 'name' => 'foo']);
$results = [['alternatives' => 'foo']];
$this->connection->getOperation(Argument::any())->shouldBeCalled()->willReturn(['done' => true, 'name' => 'foo', 'response' => ['results' => $results]]);
$this->client->setConnection($this->connection->reveal());
$res = $snippet->invoke();
$this->assertEquals(print_r($results[0]['alternatives'], true), $res->output());
}