You are here

public function DataConvertTest::testInvalidTargetTypeException in Rules 8.3

Test the behavior if nonsense target_type is set.

@covers ::execute

File

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

Class

DataConvertTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\DataConvert @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testInvalidTargetTypeException() {

  // Set the expected exception class and message.
  $this
    ->expectException(InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('Unknown target type: invalid type');
  $value = 5.5;
  $target_type = 'invalid type';
  $this
    ->executeAction($value, $target_type);
}