You are here

public function UserAuthenticationControllerTest::testConstructorDeprecations in Drupal 9

@group legacy

File

core/modules/user/tests/src/Kernel/Controller/UserAuthenticationControllerTest.php, line 29

Class

UserAuthenticationControllerTest
@coversDefaultClass \Drupal\user\Controller\UserController @group user

Namespace

Drupal\Tests\user\Kernel\Controller

Code

public function testConstructorDeprecations() {
  $this
    ->expectDeprecation('Passing the flood service to Drupal\\user\\Controller\\UserAuthenticationController::__construct is deprecated in drupal:9.1.0 and is replaced by user.flood_control in drupal:10.0.0. See https://www.drupal.org/node/3067148');
  $flood = $this
    ->prophesize(FloodInterface::class);
  $user_storage = $this
    ->prophesize(UserStorageInterface::class);
  $csrf_token = $this
    ->prophesize(CsrfTokenGenerator::class);
  $user_auth = $this
    ->prophesize(UserAuthInterface::class);
  $route_provider = $this
    ->prophesize(RouteProviderInterface::class);
  $serializer = $this
    ->prophesize(Serializer::class);
  $serializer_formats = [];
  $logger = $this
    ->prophesize(LoggerInterface::class);
  $controller = new UserAuthenticationController($flood
    ->reveal(), $user_storage
    ->reveal(), $csrf_token
    ->reveal(), $user_auth
    ->reveal(), $route_provider
    ->reveal(), $serializer
    ->reveal(), $serializer_formats, $logger
    ->reveal());
  $this
    ->assertNotNull($controller);
}