final class FakePreprocessEventFactory in Hook Event Dispatcher 8
Class FakePreprocessEventFactory.
@package Drupal\Tests\hook_event_dispatcher\Preprocess\Helpers
Hierarchy
- class \Drupal\Tests\hook_event_dispatcher\Unit\Preprocess\Helpers\FakePreprocessEventFactory implements PreprocessEventFactoryInterface
Expanded class hierarchy of FakePreprocessEventFactory
1 file declares its use of FakePreprocessEventFactory
- PreprocessEventPassTest.php in tests/
src/ Unit/ Preprocess/ PreprocessEventPassTest.php
File
- tests/
src/ Unit/ Preprocess/ Helpers/ FakePreprocessEventFactory.php, line 12
Namespace
Drupal\Tests\hook_event_dispatcher\Unit\Preprocess\HelpersView source
final class FakePreprocessEventFactory implements PreprocessEventFactoryInterface {
/**
* Fake hook.
*
* @var string
*/
private $hook;
/**
* FakePreprocessEventFactory constructor.
*
* @param string $hook
* Fake hook.
*/
public function __construct($hook) {
$this->hook = $hook;
}
/**
* Create the PreprocessEvent with the Variables object embedded.
*
* @param array $variables
* Variables.
*
* @return FakePreprocessEvent
* Created event.
*/
public function createEvent(array &$variables) {
return new FakePreprocessEvent(new FakeEventVariables($variables));
}
/**
* {@inheritdoc}
*/
public function getEventHook() {
return $this->hook;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FakePreprocessEventFactory:: |
private | property | Fake hook. | |
FakePreprocessEventFactory:: |
public | function |
Create the PreprocessEvent with the Variables object embedded. Overrides PreprocessEventFactoryInterface:: |
|
FakePreprocessEventFactory:: |
public | function |
Get the Event hook name. Overrides PreprocessEventFactoryInterface:: |
|
FakePreprocessEventFactory:: |
public | function | FakePreprocessEventFactory constructor. |