class MemoryStorageTest in Service Container 7
Same name and namespace in other branches
- 7.2 lib/Drupal/service_container/Tests/KeyValue/MemoryStorageTest.php \Drupal\service_container\Tests\KeyValue\MemoryStorageTest
Tests the key-value memory storage.
@group KeyValueStore
Hierarchy
- class \Drupal\service_container\Tests\ServiceContainerIntegrationTestBase extends \Drupal\service_container\Tests\DrupalWebTestCase
- class \Drupal\service_container\Tests\KeyValue\StorageTestBase
- class \Drupal\service_container\Tests\KeyValue\MemoryStorageTest
- class \Drupal\service_container\Tests\KeyValue\StorageTestBase
Expanded class hierarchy of MemoryStorageTest
File
- lib/
Drupal/ service_container/ Tests/ KeyValue/ MemoryStorageTest.php, line 17 - Contains Drupal\system\Tests\KeyValueStore\MemoryStorageTest.
Namespace
Drupal\service_container\Tests\KeyValueView source
class MemoryStorageTest extends StorageTestBase {
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'KeyValue MemoryStorage',
'description' => 'Tests the key-value memory storage.',
'group' => 'service_container',
);
}
protected function setUp() {
parent::setUp('service_container_test');
\ServiceContainer::reset();
$services = array();
$services['keyvalue.memory'] = array(
'class' => 'Drupal\\Core\\KeyValueStore\\KeyValueMemoryFactory',
);
$parameters = array();
$parameters['factory.keyvalue'][KeyValueFactory::DEFAULT_SETTING] = 'keyvalue.memory';
$definition['services'] = $services;
$definition['parameters'] = $parameters;
variable_set('service_container_test_definition', $definition);
\ServiceContainer::init();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MemoryStorageTest:: |
public static | function | ||
MemoryStorageTest:: |
protected | function |
Overrides StorageTestBase:: |
|
ServiceContainerIntegrationTestBase:: |
protected | property | The dependency injection container usable in the test. | |
StorageTestBase:: |
protected | property | An array of data collection labels. | |
StorageTestBase:: |
protected | property | Whether we are using an expirable key/value store. | |
StorageTestBase:: |
protected | property | An array of random stdClass objects. | |
StorageTestBase:: |
protected | property |
The profile to install as a basis for testing. Overrides ServiceContainerIntegrationTestBase:: |
|
StorageTestBase:: |
protected | function | Checks to see if two objects are identical. | |
StorageTestBase:: |
protected | function | ||
StorageTestBase:: |
protected | function | Creates storage objects for each collection defined for this class. | |
StorageTestBase:: |
public | function | 1 | |
StorageTestBase:: |
public | function | Tests CRUD operations. | |
StorageTestBase:: |
public | function | Tests expected behavior for non-existing keys. | |
StorageTestBase:: |
public | function | Tests the rename operation. | |
StorageTestBase:: |
public | function | Tests the setIfNotExists() method. |