/** * Constructor. * * @param SessionStorageInterface $storage A SessionStorageInterface instance. * @param AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag) * @param FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag) * @param FlashBagInterface $autoExpireFlashBag A FlashBagInterface instance (defaults null for default FlashBag) */ public function __construct(Application $app, SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null, FlashBagInterface $autoExpireFlashBag = null, $sTokenNamespace = 'csrf') { $this->app = $app; parent::__construct($storage, $attributes, $flashes); if (null === $autoExpireFlashBag) { $autoExpireFlashBag = new AutoExpireFlashBag(); } $this->autoExpireFlashName = $autoExpireFlashBag->getName(); $this->registerBag($autoExpireFlashBag); $this->start(); $this->sTokenNamespace = $sTokenNamespace; $this->setToken(); }
protected function setUp() { parent::setUp(); $this->bag = new FlashBag(); $this->array = array('new' => array('notice' => array('A previous flash message'))); $this->bag->initialize($this->array); }
public function testClear() { $this->assertEquals(array('notice' => array('A previous flash message')), $this->bag->clear()); }
/** * Constructor. * * @param string $name * @param string $storageKey */ public function __construct($name = 'messages', $storageKey = '_pk_messages') { parent::__construct($storageKey); $this->setName($name); }