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

ToneAnalyzer/tests/Model/UtteranceAnalysesTest.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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\UtteranceAnalyses;
7
use IBM\Watson\ToneAnalyzer\Model\UtteranceAnalysis;
8
use PHPUnit\Framework\Constraint\IsType;
9
10
class UtteranceAnalysesTest extends AbstractTestCase
11
{
12 View Code Duplication
    public function testCreate()
0 ignored issues
show
This method 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...
13
    {
14
        $response = $this->getMockResponse('ToneChatResponse.json');
15
        $data = json_decode($response->getBody(), true);
16
17
        $utteranceAnalyses = UtteranceAnalyses::create($data);
18
19
        $this->assertInstanceOf(UtteranceAnalyses::class, $utteranceAnalyses);
20
    }
21
22 View Code Duplication
    public function testGetTones()
0 ignored issues
show
This method 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...
23
    {
24
        $response = $this->getMockResponse('ToneChatResponse.json');
25
        $data = json_decode($response->getBody(), true);
26
27
        $utteranceAnalyses = UtteranceAnalyses::create($data);
28
29
        $this->assertInstanceOf(UtteranceAnalyses::class, $utteranceAnalyses);
30
        $this->assertInternalType(IsType::TYPE_ARRAY, $utteranceAnalyses->getTones());
31
    }
32
33 View Code Duplication
    public function testGetWarning()
0 ignored issues
show
This method 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...
34
    {
35
        $response = $this->getMockResponse('ToneChatResponse.json');
36
        $data = json_decode($response->getBody(), true);
37
38
        $utteranceAnalyses = UtteranceAnalyses::create($data);
39
40
        $this->assertSame('Content contains more than 50 utterances.', $utteranceAnalyses->getWarning());
41
    }
42
}
43