TestSession.php in Rules 8.3
File
tests/src/Unit/TestSession.php
View source
<?php
namespace Drupal\Tests\rules\Unit;
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
class TestSession implements SessionInterface {
protected $logs = [];
public function all() {
}
public function clear() {
}
public function get($key, $default = NULL) {
if (isset($this->logs[$key])) {
return $this->logs[$key];
}
else {
return $default;
}
}
public function getBag($name) {
}
public function getId() {
}
public function getMetadataBag() {
}
public function getName() {
}
public function has($name) {
}
public function invalidate($lifetime = NULL) {
}
public function isStarted() {
}
public function migrate($destroy = FALSE, $lifetime = NULL) {
}
public function registerBag(SessionBagInterface $bag) {
}
public function remove($key) {
if (isset($this->logs[$key])) {
$return = $this->logs[$key];
unset($this->logs[$key]);
return $return;
}
else {
return NULL;
}
}
public function replace(array $attributes) {
}
public function save() {
}
public function set($key, $value) {
$this->logs[$key] = $value;
}
public function setId($id) {
}
public function setName($name) {
}
public function start() {
}
}
Classes
Name |
Description |
TestSession |
Implements just the methods we need for the Rules unit tests. |