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

SentenceAnalysisTest::testSentences()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 13
Ratio 100 %

Importance

Changes 0
Metric Value
dl 13
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\SentenceAnalysis;
7
8 View Code Duplication
class SentenceAnalysisTest extends AbstractTestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    public function testSentences()
11
    {
12
        $response = $this->getMockResponse('ToneResponse.json');
13
        $data = json_decode($response->getBody(), true);
14
15
        $sentence = $data['sentences_tone'][0];
16
17
        $analysis = SentenceAnalysis::create($sentence);
18
19
        $this->assertSame(0, $analysis->getId());
20
        $this->assertSame('Team, I know that times are tough!', $analysis->getText());
21
        $this->assertNotEmpty($analysis->getTones());
22
    }
23
}
24