function DataSetTest::testPrimitiveValues

Tests that primitive values can be set.

@covers ::execute

File

tests/src/Unit/Integration/RulesAction/DataSetTest.php, line 42

Class

DataSetTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\DataSet @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testPrimitiveValues() {
    $this->action
        ->setContextValue('data', 'original')
        ->setContextValue('value', 'replacement');
    $this->action
        ->execute();
    $this->assertSame('replacement', $this->action
        ->getContextValue('data'));
    $this->assertSame([], $this->action
        ->autoSaveContext());
}