Loading modules/base/drush.services.yml +1 −1 Original line number Diff line number Diff line services: eca_base.commands: class: Drupal\eca_base\Commands\EcaBaseCommands arguments: [] arguments: ['@event_dispatcher'] tags: - { name: drush.command } modules/base/src/Commands/EcaBaseCommands.php +15 −1 Original line number Diff line number Diff line Loading @@ -5,12 +5,26 @@ namespace Drupal\eca_base\Commands; use Drupal\eca_base\BaseEvents; use Drupal\eca_base\Event\CustomEvent; use Drush\Commands\DrushCommands; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * A Drush commandfile. */ class EcaBaseCommands extends DrushCommands { /** * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface */ protected EventDispatcherInterface $eventDispatcher; /** * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher */ public function __construct(EventDispatcherInterface $eventDispatcher) { parent::__construct(); $this->eventDispatcher = $eventDispatcher; } /** * Trigger custom event with given event ID. * Loading @@ -24,7 +38,7 @@ class EcaBaseCommands extends DrushCommands { */ public function triggerCustomEvent(string $id): void { $event = new CustomEvent($id, []); \Drupal::service('event_dispatcher')->dispatch($event, BaseEvents::CUSTOM); $this->eventDispatcher->dispatch($event, BaseEvents::CUSTOM); } } modules/config/tests/src/Kernel/ConfigWriteTest.php +0 −2 Original line number Diff line number Diff line Loading @@ -57,8 +57,6 @@ class ConfigWriteTest extends KernelTestBase { public function testConfigWrite() { /** @var \Drupal\Core\Action\ActionManager $action_manager */ $action_manager = \Drupal::service('plugin.manager.action'); /** @var \Drupal\eca\Token\TokenInterface $token_services */ $token_services = \Drupal::service('eca.token_services'); /** @var \Drupal\Core\Session\AccountSwitcherInterface $account_switcher */ $account_switcher = \Drupal::service('account_switcher'); Loading modules/content/tests/src/Kernel/ContentExecutionChainTest.php +0 −1 Original line number Diff line number Diff line Loading @@ -234,7 +234,6 @@ class ContentExecutionChainTest extends KernelTestBase { // The next test will execute the same configuration on a non-priviledged // user. That user only has update access to the published node, therefore // the unpublished one must not be changed by ECA. // Disable the ECA config first to do some value resets without executing. $ecaConfig->disable()->trustData()->save(); $published_node->title->value = 'Published node'; Loading modules/content/tests/src/Kernel/TokenLoadEntityRefTest.php +1 −2 Original line number Diff line number Diff line Loading @@ -132,7 +132,6 @@ class TokenLoadEntityRefTest extends KernelTestBase { $node->field_node_ref->target_id = $referenced->id(); $node->setNewRevision(TRUE); $node->save(); $second_vid = $node->getRevisionId(); // Create an action that that loads the referenced entity. /** @var \Drupal\eca_content\Plugin\Action\SetFieldValue $action */ Loading Loading
modules/base/drush.services.yml +1 −1 Original line number Diff line number Diff line services: eca_base.commands: class: Drupal\eca_base\Commands\EcaBaseCommands arguments: [] arguments: ['@event_dispatcher'] tags: - { name: drush.command }
modules/base/src/Commands/EcaBaseCommands.php +15 −1 Original line number Diff line number Diff line Loading @@ -5,12 +5,26 @@ namespace Drupal\eca_base\Commands; use Drupal\eca_base\BaseEvents; use Drupal\eca_base\Event\CustomEvent; use Drush\Commands\DrushCommands; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * A Drush commandfile. */ class EcaBaseCommands extends DrushCommands { /** * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface */ protected EventDispatcherInterface $eventDispatcher; /** * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher */ public function __construct(EventDispatcherInterface $eventDispatcher) { parent::__construct(); $this->eventDispatcher = $eventDispatcher; } /** * Trigger custom event with given event ID. * Loading @@ -24,7 +38,7 @@ class EcaBaseCommands extends DrushCommands { */ public function triggerCustomEvent(string $id): void { $event = new CustomEvent($id, []); \Drupal::service('event_dispatcher')->dispatch($event, BaseEvents::CUSTOM); $this->eventDispatcher->dispatch($event, BaseEvents::CUSTOM); } }
modules/config/tests/src/Kernel/ConfigWriteTest.php +0 −2 Original line number Diff line number Diff line Loading @@ -57,8 +57,6 @@ class ConfigWriteTest extends KernelTestBase { public function testConfigWrite() { /** @var \Drupal\Core\Action\ActionManager $action_manager */ $action_manager = \Drupal::service('plugin.manager.action'); /** @var \Drupal\eca\Token\TokenInterface $token_services */ $token_services = \Drupal::service('eca.token_services'); /** @var \Drupal\Core\Session\AccountSwitcherInterface $account_switcher */ $account_switcher = \Drupal::service('account_switcher'); Loading
modules/content/tests/src/Kernel/ContentExecutionChainTest.php +0 −1 Original line number Diff line number Diff line Loading @@ -234,7 +234,6 @@ class ContentExecutionChainTest extends KernelTestBase { // The next test will execute the same configuration on a non-priviledged // user. That user only has update access to the published node, therefore // the unpublished one must not be changed by ECA. // Disable the ECA config first to do some value resets without executing. $ecaConfig->disable()->trustData()->save(); $published_node->title->value = 'Published node'; Loading
modules/content/tests/src/Kernel/TokenLoadEntityRefTest.php +1 −2 Original line number Diff line number Diff line Loading @@ -132,7 +132,6 @@ class TokenLoadEntityRefTest extends KernelTestBase { $node->field_node_ref->target_id = $referenced->id(); $node->setNewRevision(TRUE); $node->save(); $second_vid = $node->getRevisionId(); // Create an action that that loads the referenced entity. /** @var \Drupal\eca_content\Plugin\Action\SetFieldValue $action */ Loading