From 79859238b495c7534913dbc9e181cf7f640d06f4 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Mon, 25 Feb 2013 02:44:40 +0400 Subject: [PATCH] more tests for Dictionary --- tests/unit/framework/base/DictionaryTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/framework/base/DictionaryTest.php b/tests/unit/framework/base/DictionaryTest.php index 7828300..c4a2577 100644 --- a/tests/unit/framework/base/DictionaryTest.php +++ b/tests/unit/framework/base/DictionaryTest.php @@ -62,6 +62,8 @@ class DictionaryTest extends \yiiunit\TestCase $this->dictionary->add('key3',$this->item3); $this->assertEquals(3,$this->dictionary->getCount()); $this->assertTrue($this->dictionary->contains('key3')); + + $this->dictionary[] = 'test'; } public function testRemove() @@ -74,9 +76,15 @@ class DictionaryTest extends \yiiunit\TestCase public function testClear() { + $this->dictionary->add('key3',$this->item3); $this->dictionary->clear(); $this->assertEquals(0,$this->dictionary->getCount()); $this->assertTrue(!$this->dictionary->contains('key1') && !$this->dictionary->contains('key2')); + + $this->dictionary->add('key3',$this->item3); + $this->dictionary->clear(true); + $this->assertEquals(0,$this->dictionary->getCount()); + $this->assertTrue(!$this->dictionary->contains('key1') && !$this->dictionary->contains('key2')); } public function testContains()