public function CacheFlushTest::createTestEntitys in CacheFlush 8
Create cacheflush test entities.
1 call to CacheFlushTest::createTestEntitys()
- CacheFlushTest::clearPresetMenu in tests/
src/ Functional/ CacheFlushTest.php - Check clear cache.
File
- tests/
src/ Functional/ CacheFlushTest.php, line 126
Class
- CacheFlushTest
- Test cacheflush API.
Namespace
Drupal\Tests\cacheflush\FunctionalCode
public function createTestEntitys() {
$data = [];
foreach (CacheflushApi::create($this->container)
->getOptionList() as $key => $value) {
$data[$key]['functions'] = $value['functions'];
}
$data = serialize($data);
$entity = cacheflush_create([
'title' => 'Enabled',
'status' => 1,
'data' => $data,
]);
$entity
->save();
$entity = cacheflush_create([
'title' => 'Disabled',
'status' => 0,
'data' => $data,
]);
$entity
->save();
}