class TestMemoryBackend in Search API 8
A variant of the memory cache backend that allows to change the request time.
Hierarchy
- class \Drupal\Core\Cache\MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterface
- class \Drupal\Tests\search_api\Kernel\Views\TestMemoryBackend
Expanded class hierarchy of TestMemoryBackend
File
- tests/
src/ Kernel/ Views/ TestMemoryBackend.php, line 10
Namespace
Drupal\Tests\search_api\Kernel\ViewsView source
class TestMemoryBackend extends MemoryBackend {
/**
* The simulated request time.
*
* @var int|null
*/
protected $requestTime;
/**
* {@inheritdoc}
*/
public function getRequestTime() {
return $this->requestTime ?: parent::getRequestTime();
}
/**
* Sets the request time.
*
* @param int $time
* The request time to set.
*/
public function setRequestTime($time) {
$this->requestTime = $time;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheBackendInterface:: |
constant | Indicates that the item should never be removed unless explicitly deleted. | ||
MemoryBackend:: |
protected | property | Array to store cache objects. | |
MemoryBackend:: |
public | function |
Deletes an item from the cache. Overrides CacheBackendInterface:: |
1 |
MemoryBackend:: |
public | function |
Deletes all cache items in a bin. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function |
Deletes multiple items from the cache. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function |
Performs garbage collection on a cache bin. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function |
Returns data from the persistent cache. Overrides CacheBackendInterface:: |
1 |
MemoryBackend:: |
public | function |
Returns data from the persistent cache when given an array of cache IDs. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function |
Marks a cache item as invalid. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function |
Marks all cache items as invalid. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function |
Marks cache items as invalid. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function |
Marks cache items with any of the specified tags as invalid. Overrides CacheTagsInvalidatorInterface:: |
|
MemoryBackend:: |
protected | function | Prepares a cached item. | 1 |
MemoryBackend:: |
public | function |
Remove a cache bin. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function | Reset statically cached variables. | |
MemoryBackend:: |
public | function |
Stores data in the persistent cache. Overrides CacheBackendInterface:: |
2 |
MemoryBackend:: |
public | function |
Store multiple items in the persistent cache. Overrides CacheBackendInterface:: |
|
MemoryBackend:: |
public | function | Prevents data stored in memory backends from being serialized. | |
TestMemoryBackend:: |
protected | property | The simulated request time. | |
TestMemoryBackend:: |
public | function |
Wrapper method for REQUEST_TIME constant. Overrides MemoryBackend:: |
|
TestMemoryBackend:: |
public | function | Sets the request time. |