Google\Cloud\Tests\Snippets\Translate\TranslateClientTest::testLanguages PHP Method

testLanguages() public method

public testLanguages ( )
    public function testLanguages()
    {
        $snippet = $this->snippetFromMethod(TranslateClient::class, 'languages');
        $snippet->addLocal('translate', $this->client);
        $this->connection->listLanguages(Argument::any())->shouldbeCalled()->willReturn(['data' => ['languages' => [['language' => 'en', 'name' => 'English']]]]);
        $this->client->setConnection($this->connection->reveal());
        $res = $snippet->invoke();
        $this->assertEquals('en', $res->output());
    }