public function RngScheduledRuleTest::testRuleScheduleDeleted in RNG - Events and Registrations 3.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/RngScheduledRuleTest.php \Drupal\Tests\rng\Kernel\RngScheduledRuleTest::testRuleScheduleDeleted()
- 8 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\KernelCode
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()));
}