more tests for Dictionary

This commit is contained in:
Alexander Makarov
2013-02-25 02:44:40 +04:00
parent 411a1b84d5
commit 79859238b4

View File

@ -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()