function DataConvertTest::testConvertToString

Test the conversion to text.

@covers ::execute

File

tests/src/Unit/Integration/RulesAction/DataConvertTest.php, line 91

Class

DataConvertTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\DataConvert[[api-linebreak]] @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testConvertToString() {
  // Test the conversion to test/string.
  $value = 1.5;
  $converted = $this->executeAction($value, 'string');
  $this->assertIsString($converted->getValue());
  $this->assertEquals('string', $converted->getDataDefinition()
    ->getDataType());
  $this->assertEquals('1.5', $converted->getValue());
}