public function CachedStorageTest::testListAllStaticCache in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php \Drupal\Tests\Core\Config\CachedStorageTest::testListAllStaticCache()
- 10 core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php \Drupal\Tests\Core\Config\CachedStorageTest::testListAllStaticCache()
Test listAll static cache.
File
- core/
tests/ Drupal/ Tests/ Core/ Config/ CachedStorageTest.php, line 24
Class
- CachedStorageTest
- Tests the interaction of cache and file storage in CachedStorage.
Namespace
Drupal\Tests\Core\ConfigCode
public function testListAllStaticCache() {
$prefix = __FUNCTION__;
$storage = $this
->createMock('Drupal\\Core\\Config\\StorageInterface');
$response = [
"{$prefix}." . $this
->randomMachineName(),
"{$prefix}." . $this
->randomMachineName(),
];
$storage
->expects($this
->once())
->method('listAll')
->with($prefix)
->will($this
->returnValue($response));
$cache = new NullBackend(__FUNCTION__);
$cachedStorage = new CachedStorage($storage, $cache);
$this
->assertEquals($response, $cachedStorage
->listAll($prefix));
$this
->assertEquals($response, $cachedStorage
->listAll($prefix));
}