Google\Cloud\Tests\Snippets\Translate\TranslateClientTest::testDetectLanguageBatch PHP Метод

testDetectLanguageBatch() публичный Метод

    public function testDetectLanguageBatch()
    {
        $snippet = $this->snippetFromMethod(TranslateClient::class, 'detectLanguageBatch');
        $snippet->addLocal('translate', $this->client);
        $this->connection->listDetections(Argument::any())->shouldBeCalled()->willReturn(['data' => ['detections' => [[['language' => 'en', 'confidence' => 1]]]]]);
        $this->client->setConnection($this->connection->reveal());
        $res = $snippet->invoke();
        $this->assertEquals('en', $res->output());
    }