function ExpressionSerializationTest::testConditionContainerExpressionSerialization

Tests condition container base class serialization.

File

tests/src/Unit/Integration/Engine/ExpressionSerializationTest.php, line 51

Class

ExpressionSerializationTest
Tests serializing expression objects.

Namespace

Drupal\Tests\rules\Unit\Integration\Engine

Code

public function testConditionContainerExpressionSerialization() {
    $expression = $this->rulesExpressionManager
        ->createAnd();
    $expression->addCondition('rules_test_false');
    $serialized_expression = serialize($expression);
    // @phpcs:ignore DrupalPractice.FunctionCalls.InsecureUnserialize.InsecureUnserialize
    $expression = unserialize($serialized_expression);
    $result = $expression->execute();
    $this->assertFalse($result);
}