Ejemplo n.º 1
0
 public function testClear()
 {
     $this->if($collection = new TestedModel())->and($this->mockClass('\\Spy\\Timeline\\Spread\\Entry\\EntryInterface', '\\Mock'))->and($entry = new \Mock\EntryInterface())->and($entry->getMockController()->getIdent = 'ident1')->when($collection->add($entry, 'NOTGLOBAL'))->object($collection->getIterator())->isEqualTo(new \ArrayIterator(array('NOTGLOBAL' => array('ident1' => $entry), 'GLOBAL' => array('ident1' => $entry))))->when($collection->clear())->object($collection->getIterator())->isEqualTo(new \ArrayIterator(array()));
 }