Beispiel #1
0
 public function test_remove()
 {
     $arc = new ArrayCollection(array('aap', 'aap', 'noot', 'mies'));
     $removed = $arc->remove('noot');
     $this->assertEquals('noot', $removed);
     $this->assertEquals($arc->get(0), 'aap');
     $this->assertEquals($arc->get(1), 'aap');
     $this->assertEquals($arc->get(2), null);
     $this->assertEquals($arc->get(3), 'mies');
     $removed = $arc->remove('wim');
     $this->assertFalse($removed);
     $this->assertEquals($arc->get(0), 'aap');
     $this->assertEquals($arc->get(1), 'aap');
     $this->assertEquals($arc->get(2), null);
     $this->assertEquals($arc->get(3), 'mies');
     $removed = $arc->remove('aap');
     $this->assertEquals('aap', $removed);
     $this->assertEquals($arc->get(0), null);
     $this->assertEquals($arc->get(1), 'aap');
     $this->assertEquals($arc->get(2), null);
     $this->assertEquals($arc->get(3), 'mies');
     $removed = $arc->remove('aap');
     $this->assertEquals('aap', $removed);
     $this->assertEquals($arc->get(0), null);
     $this->assertEquals($arc->get(1), null);
     $this->assertEquals($arc->get(2), null);
     $this->assertEquals($arc->get(3), 'mies');
 }
 /** {@inheritDoc} */
 public function remove($key)
 {
     $this->initialize();
     $this->isDirty = true;
     return $this->collection->remove($key);
 }
 public function remove($key)
 {
     $this->initialize();
     $this->changed = true;
     return $this->col->remove($key);
 }