From a393ac7e2e48229740c89894898acfb7209831b5 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Fri, 3 Jan 2025 07:47:19 +0100 Subject: [PATCH] fix existing tests by adding AllowEdit Signed-off-by: Timotheus Pokorra --- tests/Integration/Api/ApiV3Test.php | 2 ++ tests/Unit/Controller/ApiControllerTest.php | 4 ++++ tests/Unit/Service/FormsServiceTest.php | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/tests/Integration/Api/ApiV3Test.php b/tests/Integration/Api/ApiV3Test.php index 1ac40f4f40..fed3fc2a75 100644 --- a/tests/Integration/Api/ApiV3Test.php +++ b/tests/Integration/Api/ApiV3Test.php @@ -366,6 +366,7 @@ public function dataGetNewForm() { 'state' => 0, 'isAnonymous' => false, 'submitMultiple' => false, + 'allowEdit' => false, 'showExpiration' => false, // 'lastUpdated' => time() can not be checked exactly 'canSubmit' => true, @@ -425,6 +426,7 @@ public function dataGetFullForm() { 'state' => 0, 'isAnonymous' => false, 'submitMultiple' => false, + 'allowEdit' => false, 'showExpiration' => false, 'lastUpdated' => 123456789, 'canSubmit' => true, diff --git a/tests/Unit/Controller/ApiControllerTest.php b/tests/Unit/Controller/ApiControllerTest.php index 9b41d17967..38109537a4 100644 --- a/tests/Unit/Controller/ApiControllerTest.php +++ b/tests/Unit/Controller/ApiControllerTest.php @@ -382,6 +382,7 @@ public function dataTestCreateNewForm() { 'expires' => 0, 'isAnonymous' => false, 'submitMultiple' => false, + 'allowEdit' => false, 'showExpiration' => false, 'lastUpdated' => 123456789, 'submissionMessage' => null, @@ -503,6 +504,7 @@ public function dataCloneForm() { 'expires' => 0, 'isAnonymous' => false, 'submitMultiple' => false, + 'allowEdit' => false, 'showExpiration' => false ], 'new' => [ @@ -518,6 +520,7 @@ public function dataCloneForm() { 'expires' => 0, 'isAnonymous' => false, 'submitMultiple' => false, + 'allowEdit' => false, 'showExpiration' => false ] ] @@ -969,6 +972,7 @@ public function dataTestDeletePermission() { 'expires' => 0, 'isAnonymous' => false, 'submitMultiple' => false, + 'allowEdit' => false, 'showExpiration' => false ], ] diff --git a/tests/Unit/Service/FormsServiceTest.php b/tests/Unit/Service/FormsServiceTest.php index 609d36d34a..25f69f829c 100644 --- a/tests/Unit/Service/FormsServiceTest.php +++ b/tests/Unit/Service/FormsServiceTest.php @@ -786,24 +786,28 @@ public function dataCanSubmit() { 'allowFormOwner' => [ 'ownerId' => 'currentUser', 'submitMultiple' => false, + 'allowEdit' => false, 'hasFormSubmissionsByUser' => true, 'expected' => true ], 'submitMultipleGood' => [ 'ownerId' => 'someUser', 'submitMultiple' => false, + 'allowEdit' => false, 'hasFormSubmissionsByUser' => false, 'expected' => true ], 'submitMultipleNotGood' => [ 'ownerId' => 'someUser', 'submitMultiple' => false, + 'allowEdit' => false, 'hasFormSubmissionsByUser' => true, 'expected' => false ], 'submitMultiple' => [ 'ownerId' => 'someUser', 'submitMultiple' => true, + 'allowEdit' => false, 'hasFormSubmissionsByUser' => true, 'expected' => true ]