function ExpressionSerializationTest::testConditionExpressionSerialization

Tests serializing condition expressions.

File

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

Class

ExpressionSerializationTest
Tests serializing expression objects.

Namespace

Drupal\Tests\rules\Unit\Integration\Engine

Code

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