FakePreprocessEventFactory.php in Hook Event Dispatcher 8
File
tests/src/Unit/Preprocess/Helpers/FakePreprocessEventFactory.php
View source
<?php
namespace Drupal\Tests\hook_event_dispatcher\Unit\Preprocess\Helpers;
use Drupal\hook_event_dispatcher\Event\Preprocess\Factory\PreprocessEventFactoryInterface;
final class FakePreprocessEventFactory implements PreprocessEventFactoryInterface {
private $hook;
public function __construct($hook) {
$this->hook = $hook;
}
public function createEvent(array &$variables) {
return new FakePreprocessEvent(new FakeEventVariables($variables));
}
public function getEventHook() {
return $this->hook;
}
}