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

DocumentAnalysisTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTones() 0 13 1
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