Skip to content

Commit

Permalink
fixup! Adjust tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Feb 18, 2024
1 parent 19fb7cb commit 5ea7066
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/Unit/Controller/ApiControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ public function dataTestCreateNewForm() {
return [
'forms' => ['expectedForm' => [
'id' => 7,
'state' => 0,
'hash' => 'formHash',
'title' => '',
'description' => '',
Expand Down
12 changes: 10 additions & 2 deletions tests/Unit/Service/FormsServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public function dataGetForm() {
// Just the full form without submissions
'one-full-form' => [[
'id' => 42,
'state' => 0,
'hash' => 'abcdefg',
'title' => 'Form 1',
'description' => 'Description Text',
Expand Down Expand Up @@ -250,6 +251,7 @@ public function testGetForm(array $expected) {
// The form
$form = new Form();
$form->setId(42);
$form->setState(0); // default => 0 means active
$form->setHash('abcdefg');
$form->setTitle('Form 1');
$form->setDescription('Description Text');
Expand Down Expand Up @@ -341,13 +343,14 @@ public function dataGetPartialForm() {
return [
'onePartialOwnedForm' => [[
'id' => 42,
'state' => 0,
'hash' => 'abcdefg',
'title' => 'Form 1',
'expires' => 0,
'lastUpdated' => 123456789,
'permissions' => Constants::PERMISSION_ALL,
'submissionCount' => 123,
'partial' => true
'partial' => true,
]]
];
}
Expand All @@ -358,6 +361,7 @@ public function dataGetPartialForm() {
*/
public function testGetPartialForm(array $expected) {
$form = new Form();
$form->setState(0);
$form->setId(42);
$form->setHash('abcdefg');
$form->setTitle('Form 1');
Expand All @@ -384,7 +388,8 @@ public function dataGetPartialFormShared() {
'lastUpdated' => 123456789,
'permissions' => ['results', 'submit'],
'submissionCount' => 123,
'partial' => true
'state' => 0,
'partial' => true,
]]
];
}
Expand All @@ -397,6 +402,7 @@ public function dataGetPartialFormShared() {
public function testGetPartialFormShared(array $expected) {
$form = new Form();
$form->setId(42);
$form->setState(0);
$form->setHash('abcdefg');
$form->setTitle('Form 1');
$form->setOwnerId('otherUser');
Expand Down Expand Up @@ -428,6 +434,7 @@ public function dataGetPublicForm() {
// Bare form without questions, checking removed access & ownerId
'one-full-form' => [[
'id' => 42,
'state' => 0,
'hash' => 'abcdefg',
'title' => 'Form 1',
'description' => 'Description Text',
Expand Down Expand Up @@ -455,6 +462,7 @@ public function testGetPublicForm(array $expected) {
// The form
$form = new Form();
$form->setId(42);
$form->setState(0);
$form->setHash('abcdefg');
$form->setTitle('Form 1');
$form->setDescription('Description Text');
Expand Down

0 comments on commit 5ea7066

Please sign in to comment.