function MachineNameControllerTest::testMachineNameControllerDeprecation

Tests deprecation of MachineNameController.

File

core/modules/system/tests/src/Unit/Transliteration/MachineNameControllerTest.php, line 133

Class

MachineNameControllerTest
Tests that the machine name controller can transliterate strings as expected.

Namespace

Drupal\Tests\system\Unit\Transliteration

Code

public function testMachineNameControllerDeprecation() : void {
    $request = Request::create('', 'GET', [
        'text' => 'Bob',
        'langcode' => 'en',
    ]);
    $this->expectDeprecation('Drupal\\system\\MachineNameController::transliterate() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3367037');
    $json = $this->machineNameController
        ->transliterate($request);
    $this->assertEquals('"Bob"', $json->getContent());
}

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