diff options
author | Dan Ungureanu <udan1107@gmail.com> | 2015-07-14 17:39:34 +0300 |
---|---|---|
committer | Dan Ungureanu <udan1107@gmail.com> | 2015-07-14 17:39:34 +0300 |
commit | 380603a8bfebd612bbc70801d99eb727be3e36ce (patch) | |
tree | a284231f10caad1a3a90eae10decd13b2a96cc58 /tests/Components/OptionsArrayTest.php | |
parent | bb80fc6927ab07728241eea8d3322def4c70cd1d (diff) | |
download | sql-parser-380603a8bfebd612bbc70801d99eb727be3e36ce.zip sql-parser-380603a8bfebd612bbc70801d99eb727be3e36ce.tar.gz sql-parser-380603a8bfebd612bbc70801d99eb727be3e36ce.tar.bz2 |
Added switch to skip sorting options.
Renamed the keys used for options to something more relevant.
Diffstat (limited to 'tests/Components/OptionsArrayTest.php')
-rw-r--r-- | tests/Components/OptionsArrayTest.php | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/Components/OptionsArrayTest.php b/tests/Components/OptionsArrayTest.php index 8c24e3b..1c8823e 100644 --- a/tests/Components/OptionsArrayTest.php +++ b/tests/Components/OptionsArrayTest.php @@ -26,9 +26,9 @@ class OptionsArrayTest extends TestCase 1 => 'A', 2 => array( 'name' => 'B', - 'value' => '(test)', - 'value_' => '(test)', - 'equal' => true, + 'expr' => '(test)', + 'value' => 'test', + 'equals' => true, ), 3 => 'C', ), @@ -46,22 +46,19 @@ class OptionsArrayTest extends TestCase 'RESULT' => array(2, 'var'), ) ); - $this->assertEquals('(3 + 5)', (string) $component->has('SUM')); + $this->assertEquals('(3 + 5)', (string) $component->has('SUM', true)); $this->assertEquals('8', $component->has('RESULT')); } public function testHas() { - $component = new OptionsArray( + $component = OptionsArray::parse( + new Parser(), + $this->getTokensList('A B = /*comment*/ (test) C'), array( - 1 => 'A', - 2 => array( - 'name' => 'B', - 'value' => 'test', - 'value_' => 'test', - 'equal' => false, - ), - 3 => 'C' + 'A' => 1, + 'B' => array(2, 'var'), + 'C' => 3, ) ); $this->assertTrue($component->has('A')); @@ -94,8 +91,7 @@ class OptionsArrayTest extends TestCase array( 'name' => 'MAX_STATEMENT_TIME', 'value' => '42', - 'value_' => '42', - 'equal' => true, + 'equals' => true, ), ) ); |