class TestSession in Rules 8.3
Implements just the methods we need for the Rules unit tests.
Hierarchy
- class \Drupal\Tests\rules\Unit\TestSession implements \Symfony\Component\HttpFoundation\Session\SessionInterface
Expanded class hierarchy of TestSession
File
- tests/
src/ Unit/ TestSession.php, line 11
Namespace
Drupal\Tests\rules\UnitView source
class TestSession implements SessionInterface {
/**
* Simulated session storage.
*
* @var array
*/
protected $logs = [];
/**
* {@inheritdoc}
*/
public function all() {
}
/**
* {@inheritdoc}
*/
public function clear() {
}
/**
* {@inheritdoc}
*/
public function get($key, $default = NULL) {
if (isset($this->logs[$key])) {
return $this->logs[$key];
}
else {
return $default;
}
}
/**
* {@inheritdoc}
*/
public function getBag($name) {
}
/**
* {@inheritdoc}
*/
public function getId() {
}
/**
* {@inheritdoc}
*/
public function getMetadataBag() {
}
/**
* {@inheritdoc}
*/
public function getName() {
}
/**
* {@inheritdoc}
*/
public function has($name) {
}
/**
* {@inheritdoc}
*/
public function invalidate($lifetime = NULL) {
}
/**
* {@inheritdoc}
*/
public function isStarted() {
}
/**
* {@inheritdoc}
*/
public function migrate($destroy = FALSE, $lifetime = NULL) {
}
/**
* {@inheritdoc}
*/
public function registerBag(SessionBagInterface $bag) {
}
/**
* {@inheritdoc}
*/
public function remove($key) {
if (isset($this->logs[$key])) {
$return = $this->logs[$key];
unset($this->logs[$key]);
return $return;
}
else {
return NULL;
}
}
/**
* {@inheritdoc}
*/
public function replace(array $attributes) {
}
/**
* {@inheritdoc}
*/
public function save() {
}
/**
* {@inheritdoc}
*/
public function set($key, $value) {
$this->logs[$key] = $value;
}
/**
* {@inheritdoc}
*/
public function setId($id) {
}
/**
* {@inheritdoc}
*/
public function setName($name) {
}
/**
* {@inheritdoc}
*/
public function start() {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestSession:: |
protected | property | Simulated session storage. | |
TestSession:: |
public | function | Returns attributes. | |
TestSession:: |
public | function | Clears all attributes. | |
TestSession:: |
public | function | Returns an attribute. | |
TestSession:: |
public | function | Gets a bag instance by name. | |
TestSession:: |
public | function | Returns the session ID. | |
TestSession:: |
public | function | Gets session meta. | |
TestSession:: |
public | function | Returns the session name. | |
TestSession:: |
public | function | Checks if an attribute is defined. | |
TestSession:: |
public | function | Invalidates the current session. | |
TestSession:: |
public | function | Checks if the session was started. | |
TestSession:: |
public | function | Migrates the current session to a new session id while maintaining all session attributes. | |
TestSession:: |
public | function | Registers a SessionBagInterface with the session. | |
TestSession:: |
public | function | Removes an attribute. | |
TestSession:: |
public | function | Sets attributes. | |
TestSession:: |
public | function | Force the session to be saved and closed. | |
TestSession:: |
public | function | Sets an attribute. | |
TestSession:: |
public | function | Sets the session ID. | |
TestSession:: |
public | function | Sets the session name. | |
TestSession:: |
public | function | Starts the session storage. |