function MachineNameTest::testInvalidConfiguration

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/MachineNameTest.php \Drupal\Tests\migrate\Unit\process\MachineNameTest::testInvalidConfiguration()
  2. 11.x core/modules/migrate/tests/src/Unit/process/MachineNameTest.php \Drupal\Tests\migrate\Unit\process\MachineNameTest::testInvalidConfiguration()

Tests that the replacement regular expression is a string.

File

core/modules/migrate/tests/src/Unit/process/MachineNameTest.php, line 98

Class

MachineNameTest
Tests the machine name process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testInvalidConfiguration() : void {
    $configuration['replace_pattern'] = 1;
    $this->expectException(MigrateException::class);
    $this->expectExceptionMessage('The replace pattern should be a string');
    new MachineName($configuration, 'machine_name', [], $this->transliteration);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.