public function testGetSetName() { $this->assertEquals('flashes', $this->bag->getName()); $this->bag->setName('foo'); $this->assertEquals('foo', $this->bag->getName()); }
/** * Constructeur. * * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session Session * @param \Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface $flashBag FlashBag */ public function __construct(SessionInterface $session, FlashBagInterface $flashBag = null) { $this->sessionFlashBag = $session->getBag($flashBag->getName()); }