final class FakePreprocessEventFactory in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/preprocess_event_dispatcher/tests/src/Unit/Helpers/FakePreprocessEventFactory.php \Drupal\Tests\preprocess_event_dispatcher\Unit\Helpers\FakePreprocessEventFactory
Class FakePreprocessEventFactory.
Hierarchy
- class \Drupal\Tests\preprocess_event_dispatcher\Unit\Helpers\FakePreprocessEventFactory implements PreprocessEventFactoryInterface
Expanded class hierarchy of FakePreprocessEventFactory
1 file declares its use of FakePreprocessEventFactory
- PreprocessEventPassTest.php in modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ PreprocessEventPassTest.php
File
- modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ Helpers/ FakePreprocessEventFactory.php, line 11
Namespace
Drupal\Tests\preprocess_event_dispatcher\Unit\HelpersView source
final class FakePreprocessEventFactory implements PreprocessEventFactoryInterface {
/**
* Fake hook.
*
* @var string
*/
private $hook;
/**
* FakePreprocessEventFactory constructor.
*
* @param string $hook
* Fake hook.
*/
public function __construct(string $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) : AbstractPreprocessEvent {
return new FakePreprocessEvent(new FakeEventVariables($variables));
}
/**
* {@inheritdoc}
*/
public function getEventHook() : string {
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. |