Google\Cloud\Tests\Snippets\Speech\SpeechClientTest::testRecognizeWithOptions PHP Method

testRecognizeWithOptions() public method

    public function testRecognizeWithOptions()
    {
        $snippet = $this->snippetFromMethod(SpeechClient::class, 'recognize', 1);
        $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());
    }