public function MockArraySessionStorage::getBag in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php \Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage::getBag()
Gets a SessionBagInterface by name.
Parameters
string $name:
Return value
Throws
\InvalidArgumentException If the bag does not exist
Overrides SessionStorageInterface::getBag
File
- vendor/
symfony/ http-foundation/ Session/ Storage/ MockArraySessionStorage.php, line 197
Class
- MockArraySessionStorage
- MockArraySessionStorage mocks the session for unit tests.
Namespace
Symfony\Component\HttpFoundation\Session\StorageCode
public function getBag($name) {
if (!isset($this->bags[$name])) {
throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name));
}
if (!$this->started) {
$this
->start();
}
return $this->bags[$name];
}