Completed
Push — v3 ( 862d0b...57b69a )
by Beñat
05:33
created

it_reads()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Stack Exchange Api Client library.
5
 *
6
 * Copyright (c) 2014-2016 Beñat Espiña <[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 PhpSpec\BenatEspina\StackExchangeApiClient\Application\DataTransformer;
13
14
use BenatEspina\StackExchangeApiClient\Application\DataTransformer\ResponseDataTransformer;
15
use BenatEspina\StackExchangeApiClient\Application\DataTransformer\ResponseNoTransformationDataTransformer;
16
use PhpSpec\ObjectBehavior;
17
use Psr\Http\Message\ResponseInterface;
18
19
/**
20
 * Spec file of ResponseNoTransformationDataTransformer class.
21
 *
22
 * @author Beñat Espiña <[email protected]>
23
 */
24
class ResponseNoTransformationDataTransformerSpec extends ObjectBehavior
25
{
26
    function it_is_initializable()
27
    {
28
        $this->shouldHaveType(ResponseNoTransformationDataTransformer::class);
29
    }
30
31
    function it_implements_response_data_transformer()
32
    {
33
        $this->shouldImplement(ResponseDataTransformer::class);
34
    }
35
36
    function it_writes(ResponseInterface $response)
37
    {
38
        $this->write($response);
39
    }
40
41
    function it_reads(ResponseInterface $response)
42
    {
43
        $this->read($response)->shouldReturn([]);
44
45
        $this->write($response);
46
        $this->read($response)->shouldReturn($response);
47
    }
48
}
49