You are here

protected function SchedulerRulesActionsTest::setUp in Scheduler 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/SchedulerRulesActionsTest.php \Drupal\Tests\scheduler\Functional\SchedulerRulesActionsTest::setUp()

Overrides SchedulerBrowserTestBase::setUp

File

tests/src/Functional/SchedulerRulesActionsTest.php, line 25

Class

SchedulerRulesActionsTest
Tests the six actions that Scheduler provides for use in Rules module.

Namespace

Drupal\Tests\scheduler\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this->rulesStorage = $this->container
    ->get('entity_type.manager')
    ->getStorage('rules_reaction_rule');
  $this->expressionManager = $this->container
    ->get('plugin.manager.rules_expression');
  $this
    ->drupalLogin($this->adminUser);

  // Create node A which is published and enabled for Scheduling.
  $this->node_a = $this
    ->drupalCreateNode([
    'title' => 'Initial Test Node',
    'type' => $this->type,
    'uid' => $this->adminUser
      ->id(),
    'status' => TRUE,
  ]);

  // Create node B which is published but not enabled for Scheduling.
  $this->node_b = $this
    ->drupalCreateNode([
    'title' => 'Something Else',
    'type' => $this->nonSchedulerNodeType
      ->id(),
    'uid' => $this->adminUser
      ->id(),
    'status' => TRUE,
  ]);
}