Namespace
Drupal\Tests\rules\Unit
File
-
tests/src/Unit/TestSession.php
View source
<?php
namespace Drupal\Tests\rules\Unit;
if (version_compare(\Drupal::VERSION, '10') >= 0) {
class TestSession extends TestSessionBase {
public function get(string $key, mixed $default = NULL) : mixed {
if (isset($this->logs[$key])) {
return $this->logs[$key];
}
else {
return $default;
}
}
public function remove(string $key) : mixed {
if (isset($this->logs[$key])) {
$return = $this->logs[$key];
unset($this->logs[$key]);
return $return;
}
else {
return NULL;
}
}
}
}
else {
class TestSession extends TestSessionBase {
public function get($key, $default = NULL) {
if (isset($this->logs[$key])) {
return $this->logs[$key];
}
else {
return $default;
}
}
public function remove($key) {
if (isset($this->logs[$key])) {
$return = $this->logs[$key];
unset($this->logs[$key]);
return $return;
}
else {
return NULL;
}
}
}
}