Passed
Push — master ( 87e63f...d6a1bd )
by Darío
02:40
created

SQLFunctionTest::testTwoArgumentsBuildStatement()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * DronePHP (http://www.dronephp.com)
4
 *
5
 * @link      http://github.com/Pleets/DronePHP
6
 * @copyright Copyright (c) 2016-2018 Pleets. (http://www.pleets.org)
7
 * @license   http://www.dronephp.com/license
8
 * @author    Darío Rivera <[email protected]>
9
 */
10
11
namespace DroneTest\Util;
12
13
use Drone\Db\SQLFunction;
14
use PHPUnit\Framework\TestCase;
15
16
class SQLFunctionTest extends TestCase
17
{
18
    /**
19
     * Tests if we can build a ltrim statement with SQLFunction
20
     *
21
     * @return null
22
     */
23
    public function testOneArgumentBuildStatement()
24
    {
25
        $sql = new SQLFunction('ltrim', ['column_name']);
26
        $this->assertEquals('ltrim(\'column_name\')', $sql->getStatement());
27
    }
28
29
    /**
30
     * Tests if we can build a to_date statement with SQLFunction
31
     *
32
     * @return null
33
     */
34
    public function testTwoArgumentsBuildStatement()
35
    {
36
        $sql = new SQLFunction('to_date', ['column_name', 'yyyy-mm-dd']);
37
        $this->assertEquals('to_date(\'column_name\', \'yyyy-mm-dd\')', $sql->getStatement());
38
    }
39
}