From 200619afa9a90e45f4153b0efa0ad77e0091392b Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Tue, 2 Jul 2024 08:08:41 +0200 Subject: [PATCH] Fix tests --- webapp/tests/Unit/Controller/API/BaseTestCase.php | 2 +- webapp/tests/Unit/Controller/API/ContestControllerAdminTest.php | 1 + webapp/tests/Unit/Controller/API/ProblemControllerAdminTest.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/tests/Unit/Controller/API/BaseTestCase.php b/webapp/tests/Unit/Controller/API/BaseTestCase.php index 17663de2eea..c223880ddd7 100644 --- a/webapp/tests/Unit/Controller/API/BaseTestCase.php +++ b/webapp/tests/Unit/Controller/API/BaseTestCase.php @@ -377,6 +377,6 @@ public function provideSingleNotFound(): Generator protected function provideAllowedUsers(): Generator { yield ['admin', ['admin']]; - yield ['team', ['api_problem_change']]; + yield ['team', [static::$testedRole]]; } } diff --git a/webapp/tests/Unit/Controller/API/ContestControllerAdminTest.php b/webapp/tests/Unit/Controller/API/ContestControllerAdminTest.php index ed9a5b8ae5d..bfec514169f 100644 --- a/webapp/tests/Unit/Controller/API/ContestControllerAdminTest.php +++ b/webapp/tests/Unit/Controller/API/ContestControllerAdminTest.php @@ -21,6 +21,7 @@ class ContestControllerAdminTest extends ContestControllerTest { protected ?string $apiUser = 'admin'; + protected static string $testedRole = 'api_problem_change'; private function parseSortYaml(string $yamlString): array { diff --git a/webapp/tests/Unit/Controller/API/ProblemControllerAdminTest.php b/webapp/tests/Unit/Controller/API/ProblemControllerAdminTest.php index 10219f493b4..822269faaa3 100644 --- a/webapp/tests/Unit/Controller/API/ProblemControllerAdminTest.php +++ b/webapp/tests/Unit/Controller/API/ProblemControllerAdminTest.php @@ -11,6 +11,7 @@ class ProblemControllerAdminTest extends ProblemControllerTest { protected ?string $apiUser = 'admin'; + protected static string $testedRole = 'api_problem_change'; protected function setUp(): void {