MockSubscriber.php in Akamai 8.3
File
tests/src/Kernel/EventSubscriber/MockSubscriber.php
View source
<?php
namespace Drupal\Tests\akamai\Kernel\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\akamai\Event\AkamaiHeaderEvents;
use Drupal\akamai\Event\AkamaiPurgeEvents;
class MockSubscriber implements EventSubscriberInterface {
public $event;
public static function getSubscribedEvents() {
$events[AkamaiHeaderEvents::HEADER_CREATION][] = [
'onHeaderCreation',
];
$events[AkamaiPurgeEvents::PURGE_CREATION][] = [
'onPurgeCreation',
];
return $events;
}
public function onHeaderCreation(AkamaiHeaderEvents $event) {
$this->event = $event;
$event->data[] = 'on_header_creation';
}
public function onPurgeCreation(AkamaiPurgeEvents $event) {
$this->event = $event;
$event->data[] = 'on_purge_creation';
}
}