Upgrade tests to PhpUnit 10 (#5252)

This commit is contained in:
Kevin Papst
2024-12-22 01:25:30 +01:00
committed by GitHub
parent 9bd37fb695
commit c7f0508707
377 changed files with 3308 additions and 3409 deletions

View File

@@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Response;
* @group legacy
* @group integration
*/
class AuthenticationTest extends APIControllerBaseTest
class AuthenticationTest extends APIControllerBaseTestCase
{
public function testPinIsSecure(): void
{
@@ -31,11 +31,11 @@ class AuthenticationTest extends APIControllerBaseTest
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
$this->assertAccessIsGranted($client, '/api/ping');
$response = $client->getResponse()->getContent();
$this->assertIsString($response);
self::assertIsString($response);
$result = json_decode($response, true);
$this->assertIsArray($result);
$this->assertEquals(['message' => 'pong'], $result);
self::assertIsArray($result);
self::assertEquals(['message' => 'pong'], $result);
}
public function testPingWithAuthTokenAndUsername(): void
@@ -44,11 +44,11 @@ class AuthenticationTest extends APIControllerBaseTest
$this->assertAccessIsGranted($client, '/api/ping');
$response = $client->getResponse()->getContent();
$this->assertIsString($response);
self::assertIsString($response);
$result = json_decode($response, true);
$this->assertIsArray($result);
$this->assertEquals(['message' => 'pong'], $result);
self::assertIsArray($result);
self::assertEquals(['message' => 'pong'], $result);
}
public function testPingWithInvalidAuthTokenAndUsername(): void
@@ -64,15 +64,15 @@ class AuthenticationTest extends APIControllerBaseTest
'message' => 'Invalid credentials',
];
$this->assertIsString($response->getContent());
self::assertIsString($response->getContent());
$this->assertEquals(
self::assertEquals(
$data,
json_decode($response->getContent(), true),
\sprintf('The secure URL %s is not protected.', $url)
);
$this->assertEquals(
self::assertEquals(
Response::HTTP_FORBIDDEN,
$response->getStatusCode(),
\sprintf('The secure URL %s has the wrong status code %s.', $url, $response->getStatusCode())