mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-04 06:37:55 +08:00
more tests for Dictionary
This commit is contained in:
@ -62,6 +62,8 @@ class DictionaryTest extends \yiiunit\TestCase
|
|||||||
$this->dictionary->add('key3',$this->item3);
|
$this->dictionary->add('key3',$this->item3);
|
||||||
$this->assertEquals(3,$this->dictionary->getCount());
|
$this->assertEquals(3,$this->dictionary->getCount());
|
||||||
$this->assertTrue($this->dictionary->contains('key3'));
|
$this->assertTrue($this->dictionary->contains('key3'));
|
||||||
|
|
||||||
|
$this->dictionary[] = 'test';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRemove()
|
public function testRemove()
|
||||||
@ -74,9 +76,15 @@ class DictionaryTest extends \yiiunit\TestCase
|
|||||||
|
|
||||||
public function testClear()
|
public function testClear()
|
||||||
{
|
{
|
||||||
|
$this->dictionary->add('key3',$this->item3);
|
||||||
$this->dictionary->clear();
|
$this->dictionary->clear();
|
||||||
$this->assertEquals(0,$this->dictionary->getCount());
|
$this->assertEquals(0,$this->dictionary->getCount());
|
||||||
$this->assertTrue(!$this->dictionary->contains('key1') && !$this->dictionary->contains('key2'));
|
$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()
|
public function testContains()
|
||||||
|
|||||||
Reference in New Issue
Block a user