getPlaceholderList()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
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 Hgraca\MicroDbal\Crud\QueryBuilder\Sql\CreateTokenCollection;
7
use PHPUnit_Framework_TestCase;
8
9
final class CreateTokenCollectionUnitTest extends PHPUnit_Framework_TestCase
10
{
11
    /** @var array */
12
    private $dataSet = [
13
        'id' => 1,
14
        'dummy_column_1' => 'some text',
15
        'dummy_column_2' => null,
16
    ];
17
18
    /** @var CreateTokenCollection */
19
    private $createTokenCollection;
20
21
    /**
22
     * @before
23
     */
24
    public function setUpCollection()
25
    {
26
        $this->createTokenCollection = new CreateTokenCollection($this->dataSet);
27
    }
28
29
    /**
30
     * @test
31
     *
32
     * @small
33
     */
34
    public function getColumnList()
35
    {
36
        self::assertEquals(
37
            '(`id`, `dummy_column_1`, `dummy_column_2`)',
38
            $this->createTokenCollection->getColumnList()
39
        );
40
    }
41
42
    /**
43
     * @test
44
     *
45
     * @small
46
     */
47 View Code Duplication
    public function getPlaceholderList()
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...
48
    {
49
        self::assertEquals(
50
            '(' . CreateToken::BINDING_PREFIX . '0, ' . CreateToken::BINDING_PREFIX . '1, ' . CreateToken::BINDING_PREFIX . '2)',
51
            $this->createTokenCollection->getPlaceholderList()
52
        );
53
    }
54
55
    /**
56
     * @test
57
     *
58
     * @small
59
     */
60
    public function getBindingsList()
61
    {
62
        self::assertEquals(
63
            [
64
                ':c0' => 1,
65
                ':c1' => 'some text',
66
                ':c2' => null,
67
            ],
68
            $this->createTokenCollection->getBindingsList()
69
        );
70
    }
71
}
72