public function testRecognize()
{
$snippet = $this->snippetFromMethod(SpeechClient::class, 'recognize', 0);
$snippet->addLocal('speech', $this->client);
$snippet->replace('__DIR__ . \'/audio.flac\'', $this->testFile);
$transcript = 'hello world';
$this->connection->syncRecognize(Argument::any())->shouldBeCalled()->willReturn(['results' => [['alternatives' => [['transcript' => $transcript]]]]]);
$this->client->setConnection($this->connection->reveal());
$res = $snippet->invoke();
$this->assertEquals($transcript, $res->output());
}