ResponseTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 43
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testProperties() 0 9 2
A testCountProperty() 0 7 1
A getPropertyList() 0 19 1
1
<?php
2
3
/*
4
 * This file is part of the Kickbox Bundle.
5
 *
6
 * (c) Abdoul Ndiaye <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Andi\KickBoxBundle\Tests\Http;
13
14
use Andi\KickBoxBundle\Http\Response;
15
16
/**
17
 * Response Test
18
 *
19
 * @author Abdoul Ndiaye <[email protected]>
20
 *
21
 * @see    Andi\KickBoxBundle\Http\Response
22
 */
23
class ResponseTest extends \PHPUnit_Framework_TestCase
24
{
25
    public function testProperties()
26
    {
27
        $response     = new Response();
28
        $propertyList = $this->getPropertyList();
29
30
        foreach ($propertyList as $property) {
31
            $this->assertTrue(property_exists($response, $property));
32
        }
33
    }
34
35
    public function testCountProperty()
36
    {
37
        $responseReflexion = new \ReflectionClass(Response::class);
38
        $propertyList      = $responseReflexion->getProperties();
39
40
        $this->assertEquals(count($this->getPropertyList()), count($propertyList));
41
    }
42
43
    /**
44
     * @return array
45
     */
46
    protected function getPropertyList()
47
    {
48
        return [
49
            'balance',
50
            'domain',
51
            'email',
52
            'reason',
53
            'responseTime',
54
            'result',
55
            'suggestion',
56
            'sendex',
57
            'user',
58
            'acceptAll',
59
            'disposable',
60
            'free',
61
            'role',
62
            'success',
63
        ];
64
    }
65
}
66