Test Failed
Pull Request — master (#17)
by Denis
10:14
created

ResponseTest::testAddMeta()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the QueryFilterBundle package.
5
 *
6
 * (c) Denis Voytyuk <[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 Tests\Unit\Artprima\QueryFilterBundle\Response;
13
14
use Artprima\QueryFilterBundle\Response\Response;
15
use PHPUnit\Framework\TestCase;
16
17
/**
18
 * Class Response
19
 *
20
 * @author Denis Voytyuk <[email protected]>
21
 */
22
class ResponseTest extends TestCase
23
{
24
    public function testSetMeta()
25
    {
26
        $response = new Response();
27
        self::assertCount(0, $response->getMeta());
28
        $response->setMeta([
29
            'metakey1' => 'metavalue1',
30
            'metakey2' => 'metavalue2',
31
        ]);
32
        self::assertCount(2, $response->getMeta());
33
        self::assertSame('metavalue1', $response->getMeta()['metakey1']);
34
        self::assertSame('metavalue2', $response->getMeta()['metakey2']);
35
    }
36
37
    public function testAddMeta()
38
    {
39
        $response = new Response();
40
        self::assertCount(0, $response->getMeta());
41
        $response->addMeta('metakey', 'metavalue');
42
        self::assertCount(1, $response->getMeta());
43
        self::assertSame('metavalue', $response->getMeta()['metakey']);
44
    }
45
46
    public function testSetData()
47
    {
48
        $response = new Response();
49
        $response->setData(['dummy' => 'wammy']);
50
        self::assertEquals(['dummy' => 'wammy'], $response->getData());
51
    }
52
}