Upgrade tests to PhpUnit 10 (#5252)
This commit is contained in:
@@ -36,7 +36,7 @@ class PromoteUserCommandTest extends KernelTestCase
|
||||
$container = self::$kernel->getContainer();
|
||||
|
||||
$userService = $container->get(UserService::class);
|
||||
$this->assertInstanceOf(UserService::class, $userService);
|
||||
self::assertInstanceOf(UserService::class, $userService);
|
||||
|
||||
$this->application->add(new PromoteUserCommand($userService));
|
||||
}
|
||||
@@ -79,7 +79,7 @@ class PromoteUserCommandTest extends KernelTestCase
|
||||
$commandTester = $this->callCommand('john_user', 'ROLE_TEAMLEAD');
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('[OK] Role "ROLE_TEAMLEAD" has been added to user "john_user".', $output);
|
||||
self::assertStringContainsString('[OK] Role "ROLE_TEAMLEAD" has been added to user "john_user".', $output);
|
||||
|
||||
$container = self::$kernel->getContainer();
|
||||
/** @var Registry $doctrine */
|
||||
@@ -96,7 +96,7 @@ class PromoteUserCommandTest extends KernelTestCase
|
||||
$commandTester = $this->callCommand('john_user', null, true);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('[OK] User "john_user" has been promoted as a super administrator.', $output);
|
||||
self::assertStringContainsString('[OK] User "john_user" has been promoted as a super administrator.', $output);
|
||||
|
||||
$container = self::$kernel->getContainer();
|
||||
/** @var Registry $doctrine */
|
||||
@@ -113,7 +113,7 @@ class PromoteUserCommandTest extends KernelTestCase
|
||||
$commandTester = $this->callCommand('susan_super', null, true);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('[WARNING] User "susan_super" does already have the super administrator role.', $output);
|
||||
self::assertStringContainsString('[WARNING] User "susan_super" does already have the super administrator role.', $output);
|
||||
}
|
||||
|
||||
public function testPromoteTeamleadFailsOnTeamlead(): void
|
||||
@@ -121,7 +121,7 @@ class PromoteUserCommandTest extends KernelTestCase
|
||||
$commandTester = $this->callCommand('tony_teamlead', 'ROLE_TEAMLEAD', false);
|
||||
|
||||
$output = $commandTester->getDisplay();
|
||||
$this->assertStringContainsString('[WARNING] User "tony_teamlead" did already have "ROLE_TEAMLEAD" role.', $output);
|
||||
self::assertStringContainsString('[WARNING] User "tony_teamlead" did already have "ROLE_TEAMLEAD" role.', $output);
|
||||
}
|
||||
|
||||
public function testPromoteRoleAndSuperFails(): void
|
||||
|
||||
Reference in New Issue
Block a user