Passed
Push — main ( 436d8c...f01a67 )
by Peter
02:36
created

TableTest::testGetParam()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace QB\Generic\Clause;
6
7
use PHPUnit\Framework\TestCase;
8
9
class TableTest extends TestCase
10
{
11
    public function testToStringWithoutAlias()
12
    {
13
        $tableName = 'foo';
14
15
        $sut = new Table($tableName);
16
17
        $expectedSql = $tableName;
18
        $actualSql   = (string)$sut;
19
20
        $this->assertSame($expectedSql, $actualSql);
21
    }
22
23
    public function testToStringWithAlias()
24
    {
25
        $tableName = 'foo';
26
        $alias     = 'f';
27
28
        $sut = new Table($tableName, $alias);
29
30
        $expectedSql = sprintf('%s AS %s', $tableName, $alias);
31
        $actualSql   = (string)$sut;
32
33
        $this->assertSame($expectedSql, $actualSql);
34
    }
35
36
    public function testGetParam()
37
    {
38
        $sut = new Table('foo', 'f');
39
40
        $actualParams = $sut->getParams();
41
42
        $this->assertSame([], $actualParams);
43
    }
44
}
45