You are here

public function StrReplaceTest::testSearchMigrateException in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Unit/process/StrReplaceTest.php \Drupal\Tests\migrate_plus\Unit\process\StrReplaceTest::testSearchMigrateException()

Test for MigrateException for "search" configuration.

File

tests/src/Unit/process/StrReplaceTest.php, line 59

Class

StrReplaceTest
Tests the str replace process plugin.

Namespace

Drupal\Tests\migrate_plus\Unit\process

Code

public function testSearchMigrateException() {
  $value = 'vero eos et accusam et justo vero';
  $configuration['replace'] = 'that';
  $plugin = new StrReplace($configuration, 'str_replace', []);
  $this
    ->setExpectedException('\\Drupal\\migrate\\MigrateException', '"search" must be configured.');
  $plugin
    ->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty');
}