From 2d5bcacb59829b2719eff166f3a136aef6814075 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 17:00:34 +0000 Subject: [PATCH 1/2] Chore(deps): Bump nextcloud/coding-standard in /vendor-bin/cs-fixer Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.3.2 to 1.4.0. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v1.3.2...v1.4.0) --- updated-dependencies: - dependency-name: nextcloud/coding-standard dependency-version: 1.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- vendor-bin/cs-fixer/composer.lock | 57 ++++++++++++++++++------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/vendor-bin/cs-fixer/composer.lock b/vendor-bin/cs-fixer/composer.lock index 443bfea08..867d570f8 100644 --- a/vendor-bin/cs-fixer/composer.lock +++ b/vendor-bin/cs-fixer/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "kubawerlos/php-cs-fixer-custom-fixers", - "version": "v3.22.0", + "version": "v3.27.0", "source": { "type": "git", "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", - "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" + "reference": "d860473d16b906c7945206177edc7d112357a706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", - "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/d860473d16b906c7945206177edc7d112357a706", + "reference": "d860473d16b906c7945206177edc7d112357a706", "shasum": "" }, "require": { @@ -27,7 +27,7 @@ "php": "^7.4 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.6.4 || ^10.5.29" + "phpunit/phpunit": "^9.6.22 || 10.5.45 || ^11.5.7" }, "type": "library", "autoload": { @@ -48,27 +48,33 @@ "description": "A set of custom fixers for PHP CS Fixer", "support": { "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", - "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.27.0" }, - "time": "2024-08-16T20:44:35+00:00" + "funding": [ + { + "url": "https://github.com/kubawerlos", + "type": "github" + } + ], + "time": "2025-06-10T20:53:07+00:00" }, { "name": "nextcloud/coding-standard", - "version": "v1.3.2", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d" + "reference": "8e06808c1423e9208d63d1bd205b9a38bd400011" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", - "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/8e06808c1423e9208d63d1bd205b9a38bd400011", + "reference": "8e06808c1423e9208d63d1bd205b9a38bd400011", "shasum": "" }, "require": { "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", - "php": "^7.3|^8.0", + "php": "^8.0", "php-cs-fixer/shim": "^3.17" }, "type": "library", @@ -88,24 +94,27 @@ } ], "description": "Nextcloud coding standards for the php cs fixer", + "keywords": [ + "dev" + ], "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.4.0" }, - "time": "2024-10-14T16:49:05+00:00" + "time": "2025-06-19T12:27:27+00:00" }, { "name": "php-cs-fixer/shim", - "version": "v3.68.0", + "version": "v3.75.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "23acc692a99304559d4c94e9f299158ecd0ed7d1" + "reference": "eea219a577085bd13ff0cb644a422c20798316c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/23acc692a99304559d4c94e9f299158ecd0ed7d1", - "reference": "23acc692a99304559d4c94e9f299158ecd0ed7d1", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/eea219a577085bd13ff0cb644a422c20798316c7", + "reference": "eea219a577085bd13ff0cb644a422c20798316c7", "shasum": "" }, "require": { @@ -142,21 +151,21 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.68.0" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.75.0" }, - "time": "2025-01-13T17:01:38+00:00" + "time": "2025-03-31T18:45:02+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": {}, - "platform-dev": {}, + "platform": [], + "platform-dev": [], "platform-overrides": { "php": "8.1" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } From dbd7135a3f19964a41257a15ad885da1700c1c0f Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 25 Jun 2025 19:17:47 +0200 Subject: [PATCH 2/2] chore: adjust code style Signed-off-by: Ferdinand Thiessen --- lib/Activity/ActivityManager.php | 2 +- lib/Controller/ApiController.php | 6 +++--- lib/Db/FormMapper.php | 2 +- lib/FormsMigrator.php | 6 +++--- .../Version020300Date20210406114130.php | 2 +- .../Version020300Date20210406133704.php | 6 +++--- .../Version030000Date20220414203511.php | 2 +- .../Version030000Date20220705192811.php | 2 +- .../Version030000Date20220707130109.php | 2 +- .../Version030000Date20220831195000.php | 2 +- .../Version030100Date20221231100426.php | 2 +- .../Version030100Date20230123182700.php | 2 +- .../Version040200Date20240402200139.php | 2 +- .../Version040200Date20240402224725.php | 2 +- .../Version050000Date20241005173955.php | 2 +- lib/Service/ConfigService.php | 2 +- lib/Service/FormsService.php | 12 ++++++------ lib/Service/SubmissionService.php | 18 +++++++++--------- tests/Unit/Activity/ActivityManagerTest.php | 4 ++-- tests/Unit/Activity/ProviderTest.php | 2 +- tests/Unit/Controller/ConfigControllerTest.php | 6 +++--- tests/Unit/Controller/PageControllerTest.php | 6 +++--- tests/Unit/Db/SubmissionMapperTest.php | 6 +++--- tests/Unit/Service/CirclesServiceTest.php | 6 +++--- tests/Unit/Service/ConfigServiceTest.php | 2 +- 25 files changed, 53 insertions(+), 53 deletions(-) diff --git a/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php index 5d88237ac..81d6fb5d2 100644 --- a/lib/Activity/ActivityManager.php +++ b/lib/Activity/ActivityManager.php @@ -16,7 +16,7 @@ use OCP\Share\IShare; class ActivityManager { - + public function __construct( protected string $appName, private ?string $userId, diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index ea30608d6..aaa235fec 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -297,9 +297,9 @@ public function updateForm(int $formId, array $keyValuePairs): DataResponse { // Don't allow to change params id, hash, ownerId, created, lastUpdated, fileId if ( - key_exists('id', $keyValuePairs) || key_exists('hash', $keyValuePairs) || - key_exists('ownerId', $keyValuePairs) || key_exists('created', $keyValuePairs) || - isset($keyValuePairs['fileId']) || key_exists('lastUpdated', $keyValuePairs) + key_exists('id', $keyValuePairs) || key_exists('hash', $keyValuePairs) + || key_exists('ownerId', $keyValuePairs) || key_exists('created', $keyValuePairs) + || isset($keyValuePairs['fileId']) || key_exists('lastUpdated', $keyValuePairs) ) { $this->logger->info('Not allowed to update id, hash, ownerId, created, fileId or lastUpdated'); throw new OCSForbiddenException('Not allowed to update id, hash, ownerId, created, fileId or lastUpdated'); diff --git a/lib/Db/FormMapper.php b/lib/Db/FormMapper.php index c0e3b5dde..9187b9835 100644 --- a/lib/Db/FormMapper.php +++ b/lib/Db/FormMapper.php @@ -34,7 +34,7 @@ public function __construct( parent::__construct($db, 'forms_v2_forms', Form::class); } - + /** * @param Entity $entity * @psalm-param Form $entity diff --git a/lib/FormsMigrator.php b/lib/FormsMigrator.php index 4a56c3c61..9acc17b82 100644 --- a/lib/FormsMigrator.php +++ b/lib/FormsMigrator.php @@ -94,8 +94,8 @@ public function export(IUser $user, IExportDestination $exportDestination, Outpu // Mark userIds with instance. foreach ($formData['submissions'] as $sKey => $submission) { // Anonymous submission or already migrated, just keep it. - if (substr($submission['userId'], 0, 10) === 'anon-user-' || - substr($submission['userId'], 0, 8) === 'unknown~') { + if (substr($submission['userId'], 0, 10) === 'anon-user-' + || substr($submission['userId'], 0, 8) === 'unknown~') { continue; } @@ -147,7 +147,7 @@ public function import(IUser $user, IImportSource $importSource, OutputInterface $form->setIsAnonymous($formData['isAnonymous']); $form->setSubmitMultiple($formData['submitMultiple']); $form->setShowExpiration($formData['showExpiration']); - + $this->formMapper->insert($form); $questionIdMap = []; diff --git a/lib/Migration/Version020300Date20210406114130.php b/lib/Migration/Version020300Date20210406114130.php index 2529afd6a..68d2fbb06 100644 --- a/lib/Migration/Version020300Date20210406114130.php +++ b/lib/Migration/Version020300Date20210406114130.php @@ -46,7 +46,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - + return null; } diff --git a/lib/Migration/Version020300Date20210406133704.php b/lib/Migration/Version020300Date20210406133704.php index 43cf3a2be..0e7197620 100644 --- a/lib/Migration/Version020300Date20210406133704.php +++ b/lib/Migration/Version020300Date20210406133704.php @@ -24,12 +24,12 @@ class Version020300Date20210406133704 extends SimpleMigrationStep { public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); - + $table = $schema->getTable('forms_v2_questions'); - + if ($table->hasColumn('mandatory') && $table->hasColumn('is_required')) { $table->dropColumn('mandatory'); - + return $schema; } diff --git a/lib/Migration/Version030000Date20220414203511.php b/lib/Migration/Version030000Date20220414203511.php index a6b6868b2..af844beed 100644 --- a/lib/Migration/Version030000Date20220414203511.php +++ b/lib/Migration/Version030000Date20220414203511.php @@ -34,7 +34,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - + return null; } } diff --git a/lib/Migration/Version030000Date20220705192811.php b/lib/Migration/Version030000Date20220705192811.php index c87666202..5a9f81f07 100644 --- a/lib/Migration/Version030000Date20220705192811.php +++ b/lib/Migration/Version030000Date20220705192811.php @@ -45,7 +45,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - + return null; } diff --git a/lib/Migration/Version030000Date20220707130109.php b/lib/Migration/Version030000Date20220707130109.php index 770521850..1a348bd5d 100644 --- a/lib/Migration/Version030000Date20220707130109.php +++ b/lib/Migration/Version030000Date20220707130109.php @@ -25,7 +25,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $schema = $schemaClosure(); $table = $schema->getTable('forms_v2_forms'); - + if ($table->hasColumn('submit_once') && $table->hasColumn('submit_multiple')) { $table->dropColumn('submit_once'); return $schema; diff --git a/lib/Migration/Version030000Date20220831195000.php b/lib/Migration/Version030000Date20220831195000.php index 7eead3b90..600656f19 100644 --- a/lib/Migration/Version030000Date20220831195000.php +++ b/lib/Migration/Version030000Date20220831195000.php @@ -32,7 +32,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - + return null; } } diff --git a/lib/Migration/Version030100Date20221231100426.php b/lib/Migration/Version030100Date20221231100426.php index e6aca92dc..caf745e19 100644 --- a/lib/Migration/Version030100Date20221231100426.php +++ b/lib/Migration/Version030100Date20221231100426.php @@ -38,7 +38,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - + return null; } } diff --git a/lib/Migration/Version030100Date20230123182700.php b/lib/Migration/Version030100Date20230123182700.php index 8ab711f6c..74059bf8d 100644 --- a/lib/Migration/Version030100Date20230123182700.php +++ b/lib/Migration/Version030100Date20230123182700.php @@ -34,7 +34,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - + return null; } } diff --git a/lib/Migration/Version040200Date20240402200139.php b/lib/Migration/Version040200Date20240402200139.php index d28033ad9..fc85d9d18 100644 --- a/lib/Migration/Version040200Date20240402200139.php +++ b/lib/Migration/Version040200Date20240402200139.php @@ -70,7 +70,7 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $qbUpdate->update('forms_v2_forms') ->set('access_enum', $qbUpdate->createParameter('access_enum')) ->where($qbUpdate->expr()->eq('id', $qbUpdate->createParameter('id'))); - + // Fetch Forms... $cursor = $qbFetch->executeQuery(); diff --git a/lib/Migration/Version040200Date20240402224725.php b/lib/Migration/Version040200Date20240402224725.php index ff836dad5..4dcf171f3 100644 --- a/lib/Migration/Version040200Date20240402224725.php +++ b/lib/Migration/Version040200Date20240402224725.php @@ -30,7 +30,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $schema = $schemaClosure(); $table = $schema->getTable('forms_v2_forms'); - + if ($table->hasColumn('access_json') && $table->hasColumn('access_enum')) { $table->dropColumn('access_json'); return $schema; diff --git a/lib/Migration/Version050000Date20241005173955.php b/lib/Migration/Version050000Date20241005173955.php index 5133b760c..e04970cfa 100644 --- a/lib/Migration/Version050000Date20241005173955.php +++ b/lib/Migration/Version050000Date20241005173955.php @@ -22,7 +22,7 @@ public function __construct( protected IDBConnection $db, ) { } - + /** * @param IOutput $output * @param Closure(): ISchemaWrapper $schemaClosure diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index 46b7ad69d..593315c9e 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -18,7 +18,7 @@ class ConfigService { private ?IUser $currentUser; - + public function __construct( protected string $appName, private IConfig $config, diff --git a/lib/Service/FormsService.php b/lib/Service/FormsService.php index db0a547b5..ec83aa39a 100644 --- a/lib/Service/FormsService.php +++ b/lib/Service/FormsService.php @@ -353,8 +353,8 @@ public function canSubmit(Form $form): bool { // Refuse access, if SubmitMultiple is not set and user already has taken part. if ( - !$form->getSubmitMultiple() && - $this->submissionMapper->hasFormSubmissionsByUser($form, $this->currentUser->getUID()) + !$form->getSubmitMultiple() + && $this->submissionMapper->hasFormSubmissionsByUser($form, $this->currentUser->getUID()) ) { return false; } @@ -446,10 +446,10 @@ private function isSharedFormShown(Form $form): bool { } // Shown if permitall and showntoall are both set. - if ($form->getAccess()['permitAllUsers'] && - $form->getAccess()['showToAllUsers'] && - $this->configService->getAllowPermitAll() && - $this->configService->getAllowShowToAll()) { + if ($form->getAccess()['permitAllUsers'] + && $form->getAccess()['showToAllUsers'] + && $this->configService->getAllowPermitAll() + && $this->configService->getAllowShowToAll()) { return true; } diff --git a/lib/Service/SubmissionService.php b/lib/Service/SubmissionService.php index baea59590..3647a3fe1 100644 --- a/lib/Service/SubmissionService.php +++ b/lib/Service/SubmissionService.php @@ -248,8 +248,8 @@ public function getSubmissionsData(Form $form, string $fileFormat, ?File $file = function (array $carry, Answer $answer) use ($questionPerQuestionId) { $questionId = $answer->getQuestionId(); - if (isset($questionPerQuestionId[$questionId]) && - $questionPerQuestionId[$questionId]->getType() === Constants::ANSWER_TYPE_FILE) { + if (isset($questionPerQuestionId[$questionId]) + && $questionPerQuestionId[$questionId]->getType() === Constants::ANSWER_TYPE_FILE) { if (array_key_exists($questionId, $carry)) { $carry[$questionId]['label'] .= "; \n" . $answer->getText(); } else { @@ -345,17 +345,17 @@ public function validateSubmission(array $questions, array $answers, string $for $questionAnswered = array_key_exists($questionId, $answers); // Check if all required questions have an answer - if ($question['isRequired'] && - (!$questionAnswered || - !array_filter($answers[$questionId], static function (string|array $value): bool { + if ($question['isRequired'] + && (!$questionAnswered + || !array_filter($answers[$questionId], static function (string|array $value): bool { // file type if (is_array($value)) { return !empty($value['uploadedFileId']); } return $value !== ''; - }) || - (!empty($question['extraSettings']['allowOtherAnswer']) && !array_filter($answers[$questionId], fn ($value) => $value !== Constants::QUESTION_EXTRASETTINGS_OTHER_PREFIX))) + }) + || (!empty($question['extraSettings']['allowOtherAnswer']) && !array_filter($answers[$questionId], fn ($value) => $value !== Constants::QUESTION_EXTRASETTINGS_OTHER_PREFIX))) ) { throw new \InvalidArgumentException(sprintf('Question "%s" is required.', $question['text'])); } @@ -462,8 +462,8 @@ private function validateDateTime(array $answers, string $format, ?string $text $previousDate = $d; if ($extraSettings) { - if ((isset($extraSettings['dateMin']) && $d < (new DateTime())->setTimestamp($extraSettings['dateMin'])) || - (isset($extraSettings['dateMax']) && $d > (new DateTime())->setTimestamp($extraSettings['dateMax'])) + if ((isset($extraSettings['dateMin']) && $d < (new DateTime())->setTimestamp($extraSettings['dateMin'])) + || (isset($extraSettings['dateMax']) && $d > (new DateTime())->setTimestamp($extraSettings['dateMax'])) ) { throw new \InvalidArgumentException(sprintf('Date is not in the allowed range for question "%s".', $text)); } diff --git a/tests/Unit/Activity/ActivityManagerTest.php b/tests/Unit/Activity/ActivityManagerTest.php index e7714d1b1..21d61d5ff 100644 --- a/tests/Unit/Activity/ActivityManagerTest.php +++ b/tests/Unit/Activity/ActivityManagerTest.php @@ -79,7 +79,7 @@ public function testPublishNewGroupShare() { $form->setTitle('TestForm-Title'); $form->setHash('abcdefg12345'); $groupId = 'sharedGroup'; - + $group = $this->createMock(IGroup::class); $user = $this->createMock(IUser::class); @@ -154,7 +154,7 @@ public function testPublishNewCircleShare() { public function testPublishNewCircleShare_circlesDisabled() { $form = $this->createMock(Form::class); - + $this->circlesService->expects($this->once()) ->method('getCircleUsers') ->with('circle') diff --git a/tests/Unit/Activity/ProviderTest.php b/tests/Unit/Activity/ProviderTest.php index afdffe5ba..7dbd241de 100644 --- a/tests/Unit/Activity/ProviderTest.php +++ b/tests/Unit/Activity/ProviderTest.php @@ -73,7 +73,7 @@ public function setUp(): void { $this->l10nFactory = $this->createMock(IFactory::class); $this->validator = $this->createMock(IValidator::class); $this->circlesService = $this->createMock(CirclesService::class); - + $this->urlGenerator->expects($this->any()) ->method('linkToRouteAbsolute') ->with('forms.page.index') diff --git a/tests/Unit/Controller/ConfigControllerTest.php b/tests/Unit/Controller/ConfigControllerTest.php index 25f3e59aa..47d18f037 100644 --- a/tests/Unit/Controller/ConfigControllerTest.php +++ b/tests/Unit/Controller/ConfigControllerTest.php @@ -60,7 +60,7 @@ public function testGetAppConfig() { 'allow' => 'someConfig', 'permit' => 'all' ]); - + $this->assertEquals(new DataResponse([ 'allow' => 'someConfig', 'permit' => 'all' @@ -99,7 +99,7 @@ public function dataUpdateAppConfig() { public function testUpdateAppConfig(string $configKey, $configValue, string $strConfig) { $this->logger->expects($this->once()) ->method('debug'); - + $this->config->expects($this->once()) ->method('setAppValue') ->with('forms', $configKey, $strConfig); @@ -110,7 +110,7 @@ public function testUpdateAppConfig(string $configKey, $configValue, string $str public function testUpdateAppConfig_unknownKey() { $this->logger->expects($this->once()) ->method('debug'); - + $this->config->expects($this->never()) ->method('setAppValue'); diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php index 4e6e6f8eb..37d3682bc 100644 --- a/tests/Unit/Controller/PageControllerTest.php +++ b/tests/Unit/Controller/PageControllerTest.php @@ -47,16 +47,16 @@ class PageControllerTest extends TestCase { /** @var IAccountManager|MockObject */ private $accountManager; - + /** @var IInitialState|MockObject */ private $initialState; /** @var IL10N|MockObject */ private $l10n; - + /** @var IURLGenerator|MockObject */ private $urlGenerator; - + /** @var IUserManager|MockObject */ private $userManager; diff --git a/tests/Unit/Db/SubmissionMapperTest.php b/tests/Unit/Db/SubmissionMapperTest.php index 6c27a217b..8d81327ea 100644 --- a/tests/Unit/Db/SubmissionMapperTest.php +++ b/tests/Unit/Db/SubmissionMapperTest.php @@ -13,7 +13,7 @@ use Test\TestCase; class SubmissionMapperTest extends TestCase { - + private SubmissionMapper $mockSubmissionMapper; @@ -36,7 +36,7 @@ public function testHasMultipleFormSubmissionsByUser(int $numberOfSubmissions, b $form = new Form(); $form->setId(1); - + $this->assertEquals($expected, $this->mockSubmissionMapper->hasMultipleFormSubmissionsByUser($form, 'user1')); } @@ -71,7 +71,7 @@ public function testHasFormSubmissionsByUser(int $numberOfSubmissions, bool $exp $form = new Form(); $form->setId(1); - + $this->assertEquals($expected, $this->mockSubmissionMapper->hasFormSubmissionsByUser($form, 'user1')); } diff --git a/tests/Unit/Service/CirclesServiceTest.php b/tests/Unit/Service/CirclesServiceTest.php index 1027808a0..772714acb 100644 --- a/tests/Unit/Service/CirclesServiceTest.php +++ b/tests/Unit/Service/CirclesServiceTest.php @@ -121,7 +121,7 @@ public function testGetCircleUsers_circlesDisabled() { ->onlyMethods(['getCircle']) ->setConstructorArgs([$this->appManager, $this->container, $this->logger]) ->getMock(); - + $circlesService->expects($this->never()) ->method('getCircle'); @@ -138,7 +138,7 @@ public function testGetCircleUsers_circleNotFound() { ->onlyMethods(['getCircle']) ->setConstructorArgs([$this->appManager, $this->container, $this->logger]) ->getMock(); - + $circlesService->expects($this->once()) ->method('getCircle') ->with('noCircle') @@ -173,7 +173,7 @@ public function testGetCircleUsers() { ->onlyMethods(['getCircle']) ->setConstructorArgs([$this->appManager, $this->container, $this->logger]) ->getMock(); - + $circlesService->expects($this->once()) ->method('getCircle') ->with('circle') diff --git a/tests/Unit/Service/ConfigServiceTest.php b/tests/Unit/Service/ConfigServiceTest.php index 8a0ec115d..a46a724fb 100644 --- a/tests/Unit/Service/ConfigServiceTest.php +++ b/tests/Unit/Service/ConfigServiceTest.php @@ -202,7 +202,7 @@ public function testCanCreateForms(array $config, bool $expected) { ->method('getUserGroupIds') ->with($this->currentUser) ->willReturn(['usersGroup']); - + $this->assertEquals($expected, $this->configService->canCreateForms()); } }