Completed
Push — develop ( 9b1d71...66130e )
by Adam
03:07 queued 01:21
created

DocumentAnalysisTest::testTones()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace IBM\Watson\ToneAnalyzer\tests\Model;
4
5
use IBM\Watson\Common\tests\Api\AbstractTestCase;
6
use IBM\Watson\ToneAnalyzer\Model\DocumentAnalysis;
7
8
class DocumentAnalysisTest extends AbstractTestCase
9
{
10
    public function testTones()
11
    {
12
        $response = $this->getMockResponse('ToneResponse.json');
13
        $data = json_decode($response->getBody(), true);
14
15
        $document = $data['document_tone'];
16
        $document['warning'] = 'Content contains more than 50 utterances';
17
18
        $analysis = DocumentAnalysis::create($document);
19
20
        $this->assertNotEmpty($analysis->getTones());
21
        $this->assertSame('Content contains more than 50 utterances', $analysis->getWarning());
22
    }
23
}
24