You are here

public function ConfigEntityTest::testSavingEmptyRule in Rules 8.3

Tests that an empty rule configuration can be saved.

File

tests/src/Kernel/ConfigEntityTest.php, line 35

Class

ConfigEntityTest
Tests storage and loading of Rules config entities.

Namespace

Drupal\Tests\rules\Kernel

Code

public function testSavingEmptyRule() {

  // This test does not perform assertions, and the @doesNotPerformAssertions
  // annotation does not work properly in DrupalCI for PHP 7.4.
  // @see https://www.drupal.org/project/rules/issues/3179763
  $this
    ->addToAssertionCount(1);
  $rule = $this->expressionManager
    ->createRule();
  $config_entity = $this->storage
    ->create([
    'id' => 'test_rule',
  ])
    ->setExpression($rule);
  $config_entity
    ->save();
}