Skip to content

Commit 986e8f9

Browse files
authored
fixup! test: update form tests to include lockedBy and lockedUntil fields
Signed-off-by: GitHub <noreply@github.com>
1 parent aa4a56a commit 986e8f9

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

tests/Integration/Api/ApiV3Test.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,8 @@ public function testUpdateFormProperties(array $expected): void {
667667
$this->assertEquals($this->testForms[0]['id'], $data);
668668

669669
$expected['lastUpdated'] = time();
670+
$expected['lockedBy'] = 'test';
671+
$expected['lockedUntil'] = time() + 900;
670672

671673
// Check if form equals updated form.
672674
$this->testGetFullForm($expected);
@@ -779,6 +781,8 @@ public function testUpdateQuestionProperties(array $fullFormExpected): void {
779781
$this->assertEquals($this->testForms[0]['questions'][0]['id'], $data);
780782

781783
$fullFormExpected['lastUpdated'] = time();
784+
$fullFormExpected['lockedBy'] = 'test';
785+
$fullFormExpected['lockedUntil'] = time() + 900;
782786

783787
// Check if form equals updated form.
784788
$this->testGetFullForm($fullFormExpected);
@@ -825,6 +829,8 @@ public function testReorderQuestions(array $fullFormExpected): void {
825829
], $data);
826830

827831
$fullFormExpected['lastUpdated'] = time();
832+
$fullFormExpected['lockedBy'] = 'test';
833+
$fullFormExpected['lockedUntil'] = time() + 900;
828834

829835
// Check if form equals updated form.
830836
$this->testGetFullForm($fullFormExpected);
@@ -855,6 +861,8 @@ public function testDeleteQuestion(array $fullFormExpected) {
855861
$this->assertEquals($this->testForms[0]['questions'][0]['id'], $data);
856862

857863
$fullFormExpected['lastUpdated'] = time();
864+
$fullFormExpected['lockedBy'] = 'test';
865+
$fullFormExpected['lockedUntil'] = time() + 900;
858866

859867
$this->testGetFullForm($fullFormExpected);
860868
}
@@ -940,6 +948,8 @@ public function testUpdateOptionProperties(array $fullFormExpected): void {
940948
$this->assertEquals($this->testForms[0]['questions'][1]['options'][0]['id'], $data);
941949

942950
$fullFormExpected['lastUpdated'] = time();
951+
$fullFormExpected['lockedBy'] = 'test';
952+
$fullFormExpected['lockedUntil'] = time() + 900;
943953

944954
// Check if form equals updated form.
945955
$this->testGetFullForm($fullFormExpected);
@@ -968,6 +978,8 @@ public function testDeleteOption(array $fullFormExpected) {
968978
$this->assertEquals($this->testForms[0]['questions'][1]['options'][0]['id'], $data);
969979

970980
$fullFormExpected['lastUpdated'] = time();
981+
$fullFormExpected['lockedBy'] = 'test';
982+
$fullFormExpected['lockedUntil'] = time() + 900;
971983
$fullFormExpected['questions'][1]['options'][0]['order'] = 1;
972984
$fullFormExpected['questions'][1]['options'][1]['order'] = 2;
973985

tests/Integration/Api/RespectAdminSettingsTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ private function setTestForms() {
4040
'created' => 12345,
4141
'expires' => 0,
4242
'state' => 0,
43+
'lockedBy' => null,
44+
'lockedUntil' => null,
4345
'is_anonymous' => false,
4446
'submit_multiple' => false,
4547
'allowEditSubmissions' => false,
@@ -61,6 +63,8 @@ private function setTestForms() {
6163
'created' => 12345,
6264
'expires' => 0,
6365
'state' => 0,
66+
'lockedBy' => null,
67+
'lockedUntil' => null,
6468
'is_anonymous' => false,
6569
'submit_multiple' => false,
6670
'allowEditSubmissions' => false,
@@ -82,6 +86,8 @@ private function setTestForms() {
8286
'created' => 12345,
8387
'expires' => 0,
8488
'state' => 0,
89+
'lockedBy' => null,
90+
'lockedUntil' => null,
8591
'is_anonymous' => false,
8692
'submit_multiple' => false,
8793
'allowEditSubmissions' => false,
@@ -112,6 +118,8 @@ private static function sharedTestForms(): array {
112118
'created' => 12345,
113119
'expires' => 0,
114120
'state' => 0,
121+
'lockedBy' => null,
122+
'lockedUntil' => null,
115123
'questions' => [],
116124
'shares' => [],
117125
'ownerId' => 'test',
@@ -199,6 +207,8 @@ public function testAllowUpdate(): void {
199207

200208
$expected = self::sharedTestForms()[0];
201209
$expected['access'] = ['permitAllUsers' => true, 'showToAllUsers' => true];
210+
$expected['lockedBy'] = 'test';
211+
$expected['lockedUntil'] = time() + 900;
202212

203213
$this->assertEquals(200, $resp->getStatusCode());
204214
$this->assertEquals($expected, $data);

0 commit comments

Comments
 (0)