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); }