/** * 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()); }
/** * 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); } }