class MockHeaderSubscriber in Akamai 8.3
Mock Event Subscriber for testing.
Hierarchy
- class \Drupal\Tests\akamai\Kernel\MockHeaderSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of MockHeaderSubscriber
File
- tests/
src/ Kernel/ MockHeaderSubscriber.php, line 11
Namespace
Drupal\Tests\akamai\KernelView source
class MockHeaderSubscriber implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[AkamaiHeaderEvents::HEADER_CREATION][] = [
'onHeaderCreation',
];
return $events;
}
/**
* Add cache tags header on cacheable responses.
*
* @param \Drupal\akamai\Event\AkamaiHeaderEvents $event
* The event to process.
*/
public function onHeaderCreation(AkamaiHeaderEvents $event) {
$event->data[] = 'helloworld';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MockHeaderSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
MockHeaderSubscriber:: |
public | function | Add cache tags header on cacheable responses. |