UpdateTokenUnitTest::getBinding()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 13
Ratio 100 %

Importance

Changes 0
Metric Value
dl 13
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace Hgraca\MicroDbal\Test\Crud\QueryBuilder\Sql;
4
5
use Hgraca\MicroDbal\Crud\QueryBuilder\Sql\UpdateToken;
6
use PHPUnit_Framework_TestCase;
7
8 View Code Duplication
final class UpdateTokenUnitTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class 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...
9
{
10
    /**
11
     * @test
12
     *
13
     * @small
14
     */
15
    public function toString()
16
    {
17
        $column = 'dummy_column';
18
        $value = 'something';
19
        $bindingCounter = 5;
20
21
        $updateToken = new UpdateToken($column, $value, $bindingCounter);
22
23
        self::assertEquals(
24
            "`$column`=" . UpdateToken::BINDING_PREFIX . $bindingCounter,
25
            $updateToken->toString()
26
        );
27
    }
28
29
    /**
30
     * @test
31
     *
32
     * @small
33
     */
34
    public function getBinding()
35
    {
36
        $column = 'dummy_column';
37
        $value = 'something';
38
        $bindingCounter = 5;
39
40
        $updateToken = new UpdateToken($column, $value, $bindingCounter);
41
42
        self::assertEquals(
43
            [UpdateToken::BINDING_PREFIX . $bindingCounter => $value],
44
            $updateToken->getBinding()
45
        );
46
    }
47
}
48