Google\Cloud\Tests\NaturalLanguage\NaturalLanguageClientTest::testAnnotateText PHP Method

testAnnotateText() public method

public testAnnotateText ( $options, $expectedOptions )
    public function testAnnotateText($options, $expectedOptions)
    {
        $content = $options['content'];
        unset($options['content']);
        $options['features'] = ['syntax', 'entities', 'sentiment'];
        $expectedOptions['features'] = ['extractSyntax' => true, 'extractEntities' => true, 'extractDocumentSentiment' => true];
        $this->connection->annotateText($expectedOptions)->willReturn([])->shouldBeCalledTimes(1);
        $this->client->setConnection($this->connection->reveal());
        $annotation = $this->client->annotateText($content, $options);
        $this->assertInstanceOf(Annotation::class, $annotation);
    }