You are here

public function RngScheduledRuleTest::testRuleScheduleNotCreated in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/RngScheduledRuleTest.php \Drupal\Tests\rng\Kernel\RngScheduledRuleTest::testRuleScheduleNotCreated()
  2. 3.x tests/src/Kernel/RngScheduledRuleTest.php \Drupal\Tests\rng\Kernel\RngScheduledRuleTest::testRuleScheduleNotCreated()

Test rule scheduler entity not created for an inactive rule.

File

tests/src/Kernel/RngScheduledRuleTest.php, line 118

Class

RngScheduledRuleTest
Scheduled rule entity is synced with parent rule status.

Namespace

Drupal\Tests\rng\Kernel

Code

public function testRuleScheduleNotCreated() {
  $this->rule
    ->setIsActive(FALSE)
    ->addComponent($this->condition)
    ->save();
  $this
    ->assertEquals(0, count(RuleSchedule::loadMultiple()));
}