function RestLoginHttpTest::testDeprecatedUserRoutesSubscriber

Same name and namespace in other branches
  1. main core/modules/rest/tests/src/Functional/RestLoginHttpTest.php \Drupal\Tests\rest\Functional\RestLoginHttpTest::testDeprecatedUserRoutesSubscriber()

Tests that DeprecatedUserRoutesSubscriber correctly alters the controller.

Attributes

#[DataProvider('providerDeprecatedUserRoutesSubscriber')]

File

core/modules/rest/tests/src/Functional/RestLoginHttpTest.php, line 613

Class

RestLoginHttpTest
Tests login and password reset via direct HTTP.

Namespace

Drupal\Tests\rest\Functional

Code

public function testDeprecatedUserRoutesSubscriber(string $routeName, string $userController, string $restController) : void {
  $this->assertEquals($restController, \Drupal::service('router.route_provider')->getRouteByName($routeName)
    ->getDefault('_controller'));
  $this->container
    ->get('module_installer')
    ->uninstall([
    'rest',
  ]);
  $this->rebuildAll();
  $this->assertEquals($userController, \Drupal::service('router.route_provider')->getRouteByName($routeName)
    ->getDefault('_controller'));
}

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