diff options
author | Deven Bansod <devenbansod.bits@gmail.com> | 2016-10-25 19:28:34 +0530 |
---|---|---|
committer | Deven Bansod <devenbansod.bits@gmail.com> | 2016-10-25 19:28:34 +0530 |
commit | c70914ac7e54904bb7e0ed0e3a9511481f69168d (patch) | |
tree | a4032e8e26a05f6165191ab84baa97e9f86c9f62 | |
parent | 9c4d5f0859048c98064be78dfca4f8a185866bb8 (diff) | |
download | sql-parser-c70914ac7e54904bb7e0ed0e3a9511481f69168d.zip sql-parser-c70914ac7e54904bb7e0ed0e3a9511481f69168d.tar.gz sql-parser-c70914ac7e54904bb7e0ed0e3a9511481f69168d.tar.bz2 |
Add tests for removal of option which has value attached to it
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
-rw-r--r-- | tests/Components/OptionsArrayTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/Components/OptionsArrayTest.php b/tests/Components/OptionsArrayTest.php index 5df776b..ea521b3 100644 --- a/tests/Components/OptionsArrayTest.php +++ b/tests/Components/OptionsArrayTest.php @@ -69,10 +69,25 @@ class OptionsArrayTest extends TestCase public function testRemove() { + /* Assertion 1 */ $component = new OptionsArray(array('a', 'b', 'c')); $this->assertTrue($component->remove('b')); $this->assertFalse($component->remove('d')); $this->assertEquals($component->options, array(0 => 'a', 2 => 'c')); + + /* Assertion 2 */ + $component = OptionsArray::parse( + new Parser(), + $this->getTokensList('A B = /*comment*/ (test) C'), + array( + 'A' => 1, + 'B' => array(2, 'var'), + 'C' => 3, + ) + ); + $this->assertEquals('test', $component->has('B')); + $component->remove('B'); + $this->assertFalse($component->has('B')); } public function testMerge() |