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

ResponseTest::testReturnJsonDecoded()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
}