コード例 #1
0
ファイル: test.php プロジェクト: atoum/atoum
 public function testRemoveExtension()
 {
     $this->if($test = new emptyTest())->then->object($test->getExtensions())->isEqualTo(new \splObjectStorage())->array($test->getObservers())->isEmpty()->object($test->removeExtension(new \mock\mageekguy\atoum\extension()))->isIdenticalTo($test)->object($test->getExtensions())->isEqualTo(new \splObjectStorage())->array($test->getObservers())->isEmpty()->if($extension = new \mock\mageekguy\atoum\extension())->and($otherExtension = new \mock\mageekguy\atoum\extension())->and($test->addExtension($extension)->addExtension($otherExtension))->then->array(iterator_to_array($test->getExtensions()))->isEqualTo(array($extension, $otherExtension))->array($test->getObservers())->isEqualTo(array($extension, $otherExtension))->object($test->removeExtension(new \mock\mageekguy\atoum\extension()))->isIdenticalTo($test)->array(iterator_to_array($test->getExtensions()))->isEqualTo(array($extension, $otherExtension))->array($test->getObservers())->isEqualTo(array($extension, $otherExtension))->object($test->removeExtension($extension))->isIdenticalTo($test)->array(iterator_to_array($test->getExtensions()))->isEqualTo(array($otherExtension))->array($test->getObservers())->isEqualTo(array($otherExtension))->object($test->removeExtension($otherExtension))->isIdenticalTo($test)->object($test->getExtensions())->isEqualTo(new \splObjectStorage())->array($test->getObservers())->isEmpty();
 }