function MachineNameControllerTest::testMachineNameController
Tests machine name controller's transliteration functionality.
@dataProvider providerTestMachineNameController
Parameters
array $request_params: An array of request parameters.
$expected_content: The expected content of the JSONresponse.
See also
\Drupal\system\MachineNameController::transliterate()
File
-
core/
modules/ system/ tests/ src/ Unit/ Transliteration/ MachineNameControllerTest.php, line 102
Class
- MachineNameControllerTest
- Tests that the machine name controller can transliterate strings as expected.
Namespace
Drupal\Tests\system\Unit\TransliterationCode
public function testMachineNameController(array $request_params, $expected_content) : void {
$request = Request::create('', 'GET', $request_params);
$json = $this->machineNameController
->transliterate($request);
$this->assertEquals($expected_content, $json->getContent());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.