diff options
Diffstat (limited to 'tests/Components/OptionsArrayTest.php')
-rw-r--r-- | tests/Components/OptionsArrayTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/Components/OptionsArrayTest.php b/tests/Components/OptionsArrayTest.php index 0c453da..42f54dd 100644 --- a/tests/Components/OptionsArrayTest.php +++ b/tests/Components/OptionsArrayTest.php @@ -36,6 +36,34 @@ class OptionsArrayTest extends TestCase ); } + public function testHas() + { + $component = new OptionsArray( + array( + 1 => 'A', + 2 => array( + 'name' => 'B', + 'value' => 'test', + 'value_' => 'test', + 'equal' => false, + ), + 3 => 'C' + ) + ); + $this->assertTrue($component->has('A')); + $this->assertEquals('test', $component->has('B')); + $this->assertTrue($component->has('C')); + $this->assertFalse($component->has('D')); + } + + public function testRemove() + { + $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')); + } + public function testMerge() { $component = new OptionsArray(array('a')); |