KickBoxApiExceptionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testException() 0 12 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\Exception;
13
14
use Andi\KickBoxBundle\Exception\KickBoxApiException;
15
use GuzzleHttp\Psr7\Request;
16
use GuzzleHttp\Psr7\Response;
17
18
/**
19
 * Class KickBoxApiExceptionTest
20
 *
21
 * @author Abdoul Ndiaye <[email protected]>
22
 *
23
 * @see Andi\KickBoxBundle\Exception\KickBoxApiException
24
 */
25
class KickBoxApiExceptionTest extends \PHPUnit_Framework_TestCase
26
{
27
    public function testException()
28
    {
29
        $httpResponse = new Response('expectedResponse');
30
        $e = new KickBoxApiException('test', new Request('', ''), $httpResponse);
31
        $this->assertEquals(
32
            'An error occurred during the api call : test',
33
            $e->getMessage(),
34
            'default message should be returned.'
35
        );
36
37
        $this->assertEquals($httpResponse->getBody(), $e->getResponse()->getBody());
38
    }
39
}
40