CreateTokenUnitTest::toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
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\CreateToken;
6
use PHPUnit_Framework_TestCase;
7
8 View Code Duplication
final class CreateTokenUnitTest 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
        $createToken = new CreateToken($column, $value, $bindingCounter);
22
        self::assertEquals(
23
            CreateToken::BINDING_PREFIX . $bindingCounter,
24
            $createToken->toString()
25
        );
26
    }
27
28
    /**
29
     * @test
30
     *
31
     * @small
32
     */
33
    public function getBinding()
34
    {
35
        $column = 'dummy_column';
36
        $value = 'something';
37
        $bindingCounter = 5;
38
39
        $createToken = new CreateToken($column, $value, $bindingCounter);
40
41
        self::assertEquals(
42
            [CreateToken::BINDING_PREFIX . $bindingCounter => $value],
43
            $createToken->getBinding()
44
        );
45
    }
46
}
47