Skip to content

Commit f9d4ca3

Browse files
committed
tests now send proper booleans to endpoints instead of strings and ints
1 parent 74c55a7 commit f9d4ca3

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

tests/Presenters/CommentsPresenter.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class TestCommentsPresenter extends Tester\TestCase
110110
'V1:Comments',
111111
'POST',
112112
['action' => 'addComment', 'id' => '6b89a6df-f7e8-4c2c-a216-1b7cb4391647'], // mainThread
113-
['text' => 'some comment text', 'isPrivate' => 'false']
113+
['text' => 'some comment text', 'isPrivate' => false]
114114
);
115115
$response = $this->presenter->run($request);
116116
Assert::type(Nette\Application\Responses\JsonResponse::class, $response);
@@ -141,7 +141,7 @@ class TestCommentsPresenter extends Tester\TestCase
141141
'V1:Comments',
142142
'POST',
143143
['action' => 'addComment', 'id' => $assignmentSolution->getId()],
144-
['text' => 'some comment text', 'isPrivate' => 'false']
144+
['text' => 'some comment text', 'isPrivate' => false]
145145
);
146146
$response = $this->presenter->run($request);
147147
Assert::type(Nette\Application\Responses\JsonResponse::class, $response);
@@ -172,7 +172,7 @@ class TestCommentsPresenter extends Tester\TestCase
172172
'V1:Comments',
173173
'POST',
174174
['action' => 'addComment', 'id' => $referenceSolution->getId()],
175-
['text' => 'some comment text', 'isPrivate' => 'false']
175+
['text' => 'some comment text', 'isPrivate' => false]
176176
);
177177
$response = $this->presenter->run($request);
178178
Assert::type(Nette\Application\Responses\JsonResponse::class, $response);
@@ -202,7 +202,7 @@ class TestCommentsPresenter extends Tester\TestCase
202202
'V1:Comments',
203203
'POST',
204204
['action' => 'addComment', 'id' => $assignment->getId()],
205-
['text' => 'some comment text', 'isPrivate' => 'false']
205+
['text' => 'some comment text', 'isPrivate' => false]
206206
);
207207
$response = $this->presenter->run($request);
208208
Assert::type(Nette\Application\Responses\JsonResponse::class, $response);
@@ -226,7 +226,7 @@ class TestCommentsPresenter extends Tester\TestCase
226226
'V1:Comments',
227227
'POST',
228228
['action' => 'addComment', 'id' => '5d45dcd0-50e7-4b2a-a291-cfe4b5fb5cbb'], // dummy thread (nonexist)
229-
['text' => 'some comment text', 'isPrivate' => 'false']
229+
['text' => 'some comment text', 'isPrivate' => false]
230230
);
231231
$response = $this->presenter->run($request);
232232
Assert::type(Nette\Application\Responses\JsonResponse::class, $response);

tests/Presenters/ExercisesPresenter.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ class TestExercisesPresenter extends Tester\TestCase
979979
'V1:Exercises',
980980
'POST',
981981
['action' => 'setArchived', 'id' => $exercise->getId()],
982-
['archived' => 'true']
982+
['archived' => true]
983983
);
984984

985985
$this->presenter->exercises->refresh($exercise);
@@ -1002,7 +1002,7 @@ class TestExercisesPresenter extends Tester\TestCase
10021002
'V1:Exercises',
10031003
'POST',
10041004
['action' => 'setArchived', 'id' => $exercise->getId()],
1005-
['archived' => 'true']
1005+
['archived' => true]
10061006
);
10071007
},
10081008
ForbiddenRequestException::class
@@ -1022,7 +1022,7 @@ class TestExercisesPresenter extends Tester\TestCase
10221022
'V1:Exercises',
10231023
'POST',
10241024
['action' => 'setArchived', 'id' => $exercise->getId()],
1025-
['archived' => 'false']
1025+
['archived' => false]
10261026
);
10271027

10281028
$this->presenter->exercises->refresh($exercise);

tests/Presenters/InstancesPresenter.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class TestInstancesPresenter extends Tester\TestCase
9797
'V1:Instances',
9898
'POST',
9999
['action' => 'createInstance'],
100-
['name' => 'NIOT', 'description' => 'Just a new instance', 'isOpen' => 'true']
100+
['name' => 'NIOT', 'description' => 'Just a new instance', 'isOpen' => true]
101101
);
102102
$response = $this->presenter->run($request);
103103
Assert::type(Nette\Application\Responses\JsonResponse::class, $response);
@@ -121,7 +121,7 @@ class TestInstancesPresenter extends Tester\TestCase
121121
'V1:Instances',
122122
'POST',
123123
['action' => 'updateInstance', 'id' => $instance->getId()],
124-
['isOpen' => 'false']
124+
['isOpen' => false]
125125
);
126126
$response = $this->presenter->run($request);
127127
Assert::type(Nette\Application\Responses\JsonResponse::class, $response);
@@ -143,7 +143,7 @@ class TestInstancesPresenter extends Tester\TestCase
143143
'V1:Instances',
144144
'POST',
145145
['action' => 'createInstance'],
146-
['name' => 'NIOT', 'description' => 'Just a new instance', 'isOpen' => 'true']
146+
['name' => 'NIOT', 'description' => 'Just a new instance', 'isOpen' => true]
147147
);
148148
$response = $this->presenter->run($request);
149149
$newInstanceId = $response->getPayload()['payload']['id'];
@@ -225,7 +225,7 @@ class TestInstancesPresenter extends Tester\TestCase
225225
'V1:Instances',
226226
'POST',
227227
['action' => 'updateLicence', 'licenceId' => $newLicence->getId()],
228-
['note' => 'Changed description', 'validUntil' => '2020-01-01 13:02:56', 'isValid' => 'false']
228+
['note' => 'Changed description', 'validUntil' => '2020-01-01 13:02:56', 'isValid' => false]
229229
);
230230
$response = $this->presenter->run($request);
231231
Assert::type(Nette\Application\Responses\JsonResponse::class, $response);

tests/Presenters/UsersPresenter.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ class TestUsersPresenter extends Tester\TestCase
830830
$this->presenterPath,
831831
'POST',
832832
['action' => 'setAllowed', 'id' => $user->getId()],
833-
['isAllowed' => 0]
833+
['isAllowed' => false]
834834
);
835835

836836
Assert::same($user->getId(), $payload['id']);

0 commit comments

Comments
 (0)