private static function VarnishPurgeFeatureContext::purgeUrl in Varnish purger 8.2
Parameters
string $url:
1 call to VarnishPurgeFeatureContext::purgeUrl()
- VarnishPurgeFeatureContext::iPurgeTheHomepage in tests/
src/ Behat/ features/ bootstrap/ VarnishPurgeFeatureContext.php - @When I purge the home page
File
- tests/
src/ Behat/ features/ bootstrap/ VarnishPurgeFeatureContext.php, line 167
Class
- VarnishPurgeFeatureContext
- Behat steps for testing the varnish_purger module.
Code
private static function purgeUrl(string $url) {
$p = \Drupal::service('purge.purgers');
// This dummy processor is literally called "a".
$a = \Drupal::service('purge.processors')
->get('a');
$invalidations = [
\Drupal::service('purge.invalidation.factory')
->get('url', $url),
];
// Varnish does have a queue, so if we get random failures we may need a
// sleep here.
$p
->invalidate($a, $invalidations);
}