summaryrefslogtreecommitdiffstats
path: root/tests/Components/PartitionDefinitionTest.php
blob: 9a1819c96953a2af9525c18024901746ee07cf62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

namespace SqlParser\Tests\Components;

use SqlParser\Parser;
use SqlParser\Components\PartitionDefinition;

use SqlParser\Tests\TestCase;

class PartitionDefinitionTest extends TestCase
{

    public function testParse()
    {
        $component = PartitionDefinition::parse(
            new Parser(),
            $this->getTokensList('PARTITION p0 VALUES LESS THAN(1990)')
        );
        $this->assertFalse($component->isSubpartition);
        $this->assertEquals('p0', $component->name);
        $this->assertEquals('LESS THAN', $component->type);
        $this->assertEquals('(1990)', $component->expr->expr);
    }
}