public function ExpressionSerializationTest::testActionExpressionSerialization in Rules 8.3
Tests serializing action expressions.
File
- tests/
src/ Unit/ Integration/ Engine/ ExpressionSerializationTest.php, line 19
Class
- ExpressionSerializationTest
- Tests serializing expression objects.
Namespace
Drupal\Tests\rules\Unit\Integration\EngineCode
public function testActionExpressionSerialization() {
$action = $this->rulesExpressionManager
->createAction('rules_test_string', ContextConfig::create()
->setValue('text', 'test'));
$serialized_expression = serialize($action);
$action = unserialize($serialized_expression);
$result = RulesComponent::create($action)
->provideContext('concatenated')
->execute();
$this
->assertSame('testtest', $result['concatenated']);
}