Passed
Push — master ( 6e7a8b...a8bcd9 )
by Alessandro
03:35 queued 01:32
created

ResponseTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testThrowExceptionIfIsNotAJson() 0 4 1
A testReturnJsonDecoded() 0 7 1
1
<?php
2
3
4
namespace Tests\Client\Message;
5
6
7
use PHPUnit\Framework\TestCase;
8
use TrelloCycleTime\Client\Message\Response;
9
10
class ResponseTest extends TestCase
11
{
12
    /**
13
     * @expectedException TrelloCycleTime\Exception\InvalidJsonException
14
     */
15
    public function testThrowExceptionIfIsNotAJson()
16
    {
17
        Response::validate('notAJsonString');
18
    }
19
20
    public function testReturnJsonDecoded()
21
    {
22
        $jsonString = '{"foo":"bar"}';
23
        $json = Response::validate($jsonString);
24
25
        $this->assertEquals(json_decode($jsonString, true), $json);
26
    }
27
}