public function MachineNameControllerTest::testMachineNameControllerWithMissingToken in Drupal 8
Same name and namespace in other branches
- 9 core/modules/system/tests/src/Unit/Transliteration/MachineNameControllerTest.php \Drupal\Tests\system\Unit\Transliteration\MachineNameControllerTest::testMachineNameControllerWithMissingToken()
Tests the pattern validation with a missing token.
File
- core/
modules/ system/ tests/ src/ Unit/ Transliteration/ MachineNameControllerTest.php, line 114
Class
- MachineNameControllerTest
- Tests that the machine name controller can transliterate strings as expected.
Namespace
Drupal\Tests\system\Unit\TransliterationCode
public function testMachineNameControllerWithMissingToken() {
$request = Request::create('', 'GET', [
'text' => 'Bob',
'langcode' => 'en',
'replace' => 'Alice',
'replace_pattern' => 'Bob',
]);
$this
->expectException(AccessDeniedHttpException::class);
$this
->expectExceptionMessage("Missing 'replace_token' query parameter.");
$this->machineNameController
->transliterate($request);
}