Skip to content

Commit e1737bb

Browse files
committed
Fix Unit tests (unknown type to string)
Apparantly the upgraded dependencies can now also verify the type.
1 parent 0a68916 commit e1737bb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

webapp/tests/Unit/Controller/API/ClarificationControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function testAddInvalidData(string $user, array $dataToSend, string $expe
143143
public function provideAddInvalidData(): Generator
144144
{
145145
yield ['demo', [], ""];
146-
yield ['demo', ['invalidfield' => 'value'], "/text:\n.*This value should be of type unknown./"];
146+
yield ['demo', ['invalidfield' => 'value'], "/text:\n.*This value should be of type string./"];
147147
yield ['demo', ['text' => 'This is a clarification', 'from_team_id' => 'domjudge'], "Can not create a clarification from a different team."];
148148
yield ['demo', ['text' => 'This is a clarification', 'to_team_id' => 'exteam'], "Can not create a clarification that is sent to a team."];
149149
yield ['demo', ['text' => 'This is a clarification', 'problem_id' => 'prob'], "Problem 'prob' not found."];

webapp/tests/Unit/Controller/API/ContestControllerAdminTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public function provideChangeTimes(): Generator
274274

275275
// General tests
276276
yield [[], 400, ''];
277-
yield [['dummy' => 'dummy'], 400, "This value should be of type unknown."];
277+
yield [['dummy' => 'dummy'], 400, "This value should be of type string."];
278278
yield [['id' => 1], 400, 'Missing \"start_time\" or \"scoreboard_thaw_time\" in request.'];
279279
yield [['id' => 1, 'start_time' => null, 'scoreboard_thaw_time' => date('Y-m-d\TH:i:s', strtotime('+15 seconds'))], 400, 'Setting both \"start_time\" and \"scoreboard_thaw_time\" at the same time is not allowed.'];
280280

webapp/tests/Unit/Controller/API/SubmissionControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function provideAddInvalidData(): Generator
107107
yield ['demo', ['problem_id' => 'hello', 'language_id' => 'cpp', 'id' => '123'], "A team can not assign id."];
108108
yield ['demo', ['problem_id' => 'hello', 'language_id' => 'cpp', 'time' => '2021-01-01T00:00:00'], "A team can not assign time."];
109109
yield ['demo', ['problem_id' => 'hello', 'language_id' => 'cpp', 'files' => []], "No files specified."];
110-
yield ['demo', ['problem_id' => 'hello', 'language_id' => 'cpp', 'files' => [['invalidkey' => 'somevalue']]], "/files\[0\].data:\n.*This value should be of type unknown./"];
110+
yield ['demo', ['problem_id' => 'hello', 'language_id' => 'cpp', 'files' => [['invalidkey' => 'somevalue']]], "/files\[0\].data:\n.*This value should be of type string./"];
111111
yield [
112112
'demo',
113113
['problem_id' => 'hello', 'language_id' => 'cpp', 'files' => 'this is not an array'],

webapp/tests/Unit/Controller/API/UserControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@ public function testUpdateNoId(): void
9191
];
9292

9393
$response = $this->verifyApiJsonResponse('PUT', $this->helperGetEndpointURL($this->apiEndpoint) . '/someid', 400, 'admin', $data);
94-
static::assertMatchesRegularExpression('/id:\n.*This value should be of type unknown./', $response['message']);
94+
static::assertMatchesRegularExpression('/id:\n.*This value should be of type string./', $response['message']);
9595
}
9696
}

0 commit comments

Comments
 (0)