UpdateTokenCollectionUnitTest::getBindingsList()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 11

Duplication

Lines 19
Ratio 100 %

Importance

Changes 0
Metric Value
dl 19
loc 19
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
3
namespace Hgraca\MicroDbal\Test\Crud\QueryBuilder\Sql;
4
5
use Hgraca\MicroDbal\Crud\QueryBuilder\Sql\UpdateTokenCollection;
6
use PHPUnit_Framework_TestCase;
7
8
final class UpdateTokenCollectionUnitTest extends PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * @test
12
     *
13
     * @small
14
     */
15
    public function toString()
16
    {
17
        $dataSet = [
18
            'id' => 1,
19
            'dummy_column_1' => 'some text',
20
            'dummy_column_2' => null,
21
        ];
22
23
        $updateTokenCollection = new UpdateTokenCollection($dataSet);
24
25
        self::assertEquals(
26
            '`id`=:u0, `dummy_column_1`=:u1, `dummy_column_2`=:u2',
27
            $updateTokenCollection->toString()
28
        );
29
    }
30
31
    /**
32
     * @test
33
     *
34
     * @small
35
     */
36 View Code Duplication
    public function getBindingsList()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
37
    {
38
        $dataSet = [
39
            'id' => 1,
40
            'dummy_column_1' => 'some text',
41
            'dummy_column_2' => null,
42
        ];
43
44
        $updateTokenCollection = new UpdateTokenCollection($dataSet);
45
46
        self::assertEquals(
47
            [
48
                ':u0' => 1,
49
                ':u1' => 'some text',
50
                ':u2' => null,
51
            ],
52
            $updateTokenCollection->getBindingsList()
53
        );
54
    }
55
}
56