Dynamark3ResponseTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSettersAndGetters() 0 8 1
A dataProviderSettersAndGetters() 0 7 1
1
<?php
2
3
/**
4
 * This file is part of graze/dynamark3-client.
5
 *
6
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @license https://github.com/graze/dynamark3-client/blob/master/LICENSE.md
12
 * @link https://github.com/graze/dynamark3-client
13
 */
14
15
namespace Graze\Dynamark3Client\Test\Unit;
16
17
use \Graze\Dynamark3Client\Dynamark3Response;
18
19
class Dynamark3ResponseTest extends \PHPUnit_Framework_TestCase
20
{
21
    /**
22
     * @dataProvider dataProviderSettersAndGetters
23
     *
24
     * @param bool $isError
25
     * @param string $responseText
26
     * @param int $errorCode
27
     *
28
     * @return void
29
     */
30
    public function testSettersAndGetters($isError, $responseText, $errorCode = null)
31
    {
32
        $response = new Dynamark3Response($responseText, $errorCode);
33
34
        $this->assertEquals($responseText, $response->getResponseText());
35
        $this->assertEquals($errorCode, $response->getErrorCode());
36
        $this->assertEquals($isError, $response->isError());
37
    }
38
39
    /**
40
     * @return array
41
     */
42
    public function dataProviderSettersAndGetters()
43
    {
44
        return [
45
            [false, 'some text', null],
46
            [true, 'some other text', 66],
47
        ];
48
    }
49
}
50