Browse Source

more tests for Dictionary

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
79859238b4
  1. 8
      tests/unit/framework/base/DictionaryTest.php

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

Loading…
Cancel
Save