You are here

public function IntegrityCheckTest::testUsingProvidedVariables in Rules 8.3

Tests using provided variables in sub-sequent actions passes checks.

File

tests/src/Unit/Integration/Engine/IntegrityCheckTest.php, line 334

Class

IntegrityCheckTest
Test the integrity check functionality during configuration time.

Namespace

Drupal\Tests\rules\Unit\Integration\Engine

Code

public function testUsingProvidedVariables() {
  $rule = $this->rulesExpressionManager
    ->createRule();
  $rule
    ->addAction('rules_variable_add', ContextConfig::create()
    ->setValue('type', 'any')
    ->setValue('value', 'foo'));
  $rule
    ->addAction('rules_variable_add', ContextConfig::create()
    ->setValue('type', 'any')
    ->map('value', 'variable_added'));
  $violation_list = RulesComponent::create($rule)
    ->checkIntegrity();
  $this
    ->assertEquals(0, iterator_count($violation_list));
}