function image_module_test_image_effect_info_alter
Same name in other branches
- 7.x modules/image/tests/image_module_test.module \image_module_test_image_effect_info_alter()
- 9 core/modules/image/tests/modules/image_module_test/image_module_test.module \image_module_test_image_effect_info_alter()
- 8.9.x core/modules/image/tests/modules/image_module_test/image_module_test.module \image_module_test_image_effect_info_alter()
- 11.x core/modules/image/tests/modules/image_module_test/image_module_test.module \image_module_test_image_effect_info_alter()
Implements hook_image_effect_info_alter().
File
-
core/
modules/ image/ tests/ modules/ image_module_test/ image_module_test.module, line 20
Code
function image_module_test_image_effect_info_alter(&$effects) {
$state = \Drupal::state();
// The 'image_module_test.counter' state variable value is set and accessed
// from the ImageEffectsTest::testImageEffectsCaching() test and used to
// signal if the image effect plugin definitions were computed or were
// retrieved from the cache.
// @see \Drupal\Tests\image\Kernel\ImageEffectsTest::testImageEffectsCaching()
$counter = $state->get('image_module_test.counter');
// Increase the test counter, signaling that image effects were processed,
// rather than being served from the cache.
$state->set('image_module_test.counter', ++$counter);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.