Ejemplo n.º 1
0
 /**
  * Tests all() method.
  */
 public function testAll()
 {
     $this->assertTrue($this->storage->add('value', 'id'));
     $this->assertCount(1, $this->storage->all());
     $this->assertTrue($this->storage->removeById('id'));
     $this->assertFalse($this->storage->containsId('id'));
     $this->assertCount(0, $this->storage->all());
 }
Ejemplo n.º 2
0
 /**
  * Merges local storage with global storage.
  *
  * @param StorageInterface $storage Local storage
  */
 protected function mergeStorage(StorageInterface $storage)
 {
     foreach ($storage->all() as $id => $object) {
         $this->stack->getScope('global')->add($object);
     }
 }