You are here

public function RngScheduledRuleTest::testRuleScheduleDeleted 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::testRuleScheduleDeleted()
  2. 3.x tests/src/Kernel/RngScheduledRuleTest.php \Drupal\Tests\rng\Kernel\RngScheduledRuleTest::testRuleScheduleDeleted()

Test rule scheduler entity deleted if rule status changes.

File

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

Class

RngScheduledRuleTest
Scheduled rule entity is synced with parent rule status.

Namespace

Drupal\Tests\rng\Kernel

Code

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