Passed
Pull Request — master (#311)
by William
12:43
created

ExpressionArrayTest::testParse2()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace PhpMyAdmin\SqlParser\Tests\Components;
4
5
use PhpMyAdmin\SqlParser\Components\ExpressionArray;
6
use PhpMyAdmin\SqlParser\Parser;
7
use PhpMyAdmin\SqlParser\Tests\TestCase;
8
9
class ExpressionArrayTest extends TestCase
10
{
11
    public function testParse()
12
    {
13
        $component = ExpressionArray::parse(
14
            new Parser(),
15
            $this->getTokensList('(expr)'),
16
            array(
17
                'breakOnParentheses' => true
18
            )
19
        );
20
        $this->assertEquals(array(), $component);
21
    }
22
23
    public function testParse2()
24
    {
25
        $component = ExpressionArray::parse(
26
            new Parser(),
27
            $this->getTokensList('(expr) +'),
28
            array(
29
                'parenthesesDelimited' => true
30
            )
31
        );
32
        $this->assertCount(1, $component);
33
        $this->assertEquals('(expr)', $component[0]->expr);
34
    }
35
}
36