class ThemesInstalledEventTest in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/core_event_dispatcher/tests/src/Unit/Theme/ThemesInstalledEventTest.php \Drupal\Tests\core_event_dispatcher\Unit\Theme\ThemesInstalledEventTest
Class ThemesInstalledEventTest.
@group hook_event_dispatcher
Hierarchy
- class \Drupal\Tests\core_event_dispatcher\Unit\Theme\ThemesInstalledEventTest extends \PHPUnit\Framework\TestCase
Expanded class hierarchy of ThemesInstalledEventTest
File
- modules/
core_event_dispatcher/ tests/ src/ Unit/ Theme/ ThemesInstalledEventTest.php, line 17
Namespace
Drupal\Tests\core_event_dispatcher\Unit\ThemeView source
class ThemesInstalledEventTest extends TestCase {
/**
* The manager.
*
* @var \Drupal\Tests\hook_event_dispatcher\Unit\HookEventDispatcherManagerSpy
*/
private $manager;
/**
* Sets up the test.
*/
public function setUp() : void {
$builder = new ContainerBuilder();
$this->manager = new HookEventDispatcherManagerSpy();
$builder
->set('hook_event_dispatcher.manager', $this->manager);
$builder
->compile();
Drupal::setContainer($builder);
}
/**
* Themes installed event test.
*/
public function testThemesInstalledEvent() : void {
$themes = [
'classy',
'bartik',
];
core_event_dispatcher_themes_installed($themes);
/** @var \Drupal\core_event_dispatcher\Event\Theme\ThemesInstalledEvent $event */
$event = $this->manager
->getRegisteredEvent(HookEventDispatcherInterface::THEMES_INSTALLED);
self::assertSame($themes, $event
->getThemeList());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ThemesInstalledEventTest:: |
private | property | The manager. | |
ThemesInstalledEventTest:: |
public | function | Sets up the test. | |
ThemesInstalledEventTest:: |
public | function | Themes installed event test. |