From 4e8253f552bdcf1735295b7b45da3613301e973f Mon Sep 17 00:00:00 2001 From: Koen1999 Date: Tue, 28 Dec 2021 21:06:15 +0100 Subject: [PATCH] Fixed remaining issues --- .github/workflows/unit-tests.yml | 2 -- .../Activity/src/Controller/AdminController.php | 5 ++++- .../Activity/test/Mapper/ActivityMapperTest.php | 6 ++++-- module/Application/src/Mapper/BaseMapper.php | 3 ++- .../Application/test/AutomaticControllerTest.php | 16 +++++++++------- module/Application/test/BaseControllerTest.php | 7 +++++-- .../Application/test/Mapper/BaseMapperTest.php | 16 ++++++++++------ module/Application/test/TestConfigProvider.php | 2 +- module/Frontpage/test/ControllerTest.php | 1 - 9 files changed, 35 insertions(+), 23 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 48f4eccf61..e7122ed044 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -51,6 +51,4 @@ jobs: env-file: .env.dist - name: Run PHPUnit - env: - DOCKER_DB_HOST: 127.0.0.1 run: vendor/phpunit/phpunit/phpunit --bootstrap bootstrap.php --configuration phpunit.xml diff --git a/module/Activity/src/Controller/AdminController.php b/module/Activity/src/Controller/AdminController.php index c3e6d4078a..77bc368c50 100644 --- a/module/Activity/src/Controller/AdminController.php +++ b/module/Activity/src/Controller/AdminController.php @@ -22,7 +22,10 @@ AbstractContainer, Container as SessionContainer, }; -use Laminas\Stdlib\{Parameters, ResponseInterface}; +use Laminas\Stdlib\{ + Parameters, + ResponseInterface, +}; use Laminas\View\Model\ViewModel; use User\Permissions\NotAllowedException; diff --git a/module/Activity/test/Mapper/ActivityMapperTest.php b/module/Activity/test/Mapper/ActivityMapperTest.php index db7116711d..465cfbf0c7 100644 --- a/module/Activity/test/Mapper/ActivityMapperTest.php +++ b/module/Activity/test/Mapper/ActivityMapperTest.php @@ -3,8 +3,10 @@ namespace ActivityTest\Mapper; use Activity\Mapper\Activity as ActivityMapper; -use Activity\Model\Activity; -use Activity\Model\ActivityLocalisedText; +use Activity\Model\{ + Activity, + ActivityLocalisedText, +}; use Application\Mapper\BaseMapper; use ApplicationTest\Mapper\BaseMapperTest; use DateTime; diff --git a/module/Application/src/Mapper/BaseMapper.php b/module/Application/src/Mapper/BaseMapper.php index f42c356d86..8a5a2c0dbe 100644 --- a/module/Application/src/Mapper/BaseMapper.php +++ b/module/Application/src/Mapper/BaseMapper.php @@ -8,7 +8,8 @@ EntityNotFoundException, EntityRepository, OptimisticLockException, - Exception\ORMException}; + Exception\ORMException, +}; abstract class BaseMapper { diff --git a/module/Application/test/AutomaticControllerTest.php b/module/Application/test/AutomaticControllerTest.php index 77c335429d..e1dc7660ae 100644 --- a/module/Application/test/AutomaticControllerTest.php +++ b/module/Application/test/AutomaticControllerTest.php @@ -4,11 +4,13 @@ use Exception; use Laminas\Router\Exception\InvalidArgumentException; -use Laminas\Router\Http\Literal; -use Laminas\Router\Http\Part; -use Laminas\Router\Http\Regex; -use Laminas\Router\Http\Segment; -use Laminas\Router\Http\TreeRouteStack; +use Laminas\Router\Http\{ + Literal, + Part, + Regex, + Segment, + TreeRouteStack, +}; use Laminas\Router\PriorityList; use RuntimeException; use Traversable; @@ -113,7 +115,7 @@ protected function parseLiteral(Literal $literal): void $this->parseUrl($url); } - protected function parseRegex(Regex $regex) + protected function parseRegex(Regex $regex): void { $url = $regex->assemble(); $this->parseUrl($url); @@ -153,7 +155,7 @@ protected function testRoutePost(string $url): void protected function getParams(): array { - $params = array(); + $params = []; $params['id'] = 1; $params['appId'] = 1; diff --git a/module/Application/test/BaseControllerTest.php b/module/Application/test/BaseControllerTest.php index 896fe2e0ab..ccd8360646 100644 --- a/module/Application/test/BaseControllerTest.php +++ b/module/Application/test/BaseControllerTest.php @@ -11,7 +11,10 @@ use Laminas\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; use PHPUnit\Framework\MockObject\MockObject; use User\Authentication\AuthenticationService; -use User\Model\{User, UserRole}; +use User\Model\{ + User, + UserRole, +}; abstract class BaseControllerTest extends AbstractHttpControllerTestCase { @@ -84,7 +87,7 @@ private static function initServiceManager(array $configuration = []): ServiceMa private function bootstrapApplication( ServiceManager $serviceManager, - array $configuration = [] + array $configuration = [], ): Application { // Prepare list of listeners to bootstrap $listenersFromAppConfig = $configuration['listeners'] ?? []; diff --git a/module/Application/test/Mapper/BaseMapperTest.php b/module/Application/test/Mapper/BaseMapperTest.php index eb847f493d..7da3ce08ad 100644 --- a/module/Application/test/Mapper/BaseMapperTest.php +++ b/module/Application/test/Mapper/BaseMapperTest.php @@ -4,8 +4,10 @@ use Application\Mapper\BaseMapper; use ApplicationTest\TestConfigProvider; -use Doctrine\ORM\EntityManager; -use Doctrine\ORM\EntityNotFoundException; +use Doctrine\ORM\{ + EntityManager, + EntityNotFoundException, +}; use Laminas\Mvc\Application; use Laminas\Mvc\Service\ServiceManagerConfig; use Laminas\ServiceManager\ServiceManager; @@ -59,7 +61,7 @@ public function getApplication(): Application /** * Variation of {@link Application::init} but without initial bootstrapping. */ - private static function initServiceManager($configuration = []): ServiceManager + private static function initServiceManager(array $configuration = []): ServiceManager { // Prepare the service manager $smConfig = $configuration['service_manager'] ?? []; @@ -75,12 +77,14 @@ private static function initServiceManager($configuration = []): ServiceManager return $serviceManager; } - protected function setUpMockedServices() + protected function setUpMockedServices(): void { } - private function bootstrapApplication($serviceManager, $configuration = []): Application - { + private function bootstrapApplication( + ServiceManager $serviceManager, + array $configuration = [], + ): Application { // Prepare list of listeners to bootstrap $listenersFromAppConfig = $configuration['listeners'] ?? []; $config = $serviceManager->get('config'); diff --git a/module/Application/test/TestConfigProvider.php b/module/Application/test/TestConfigProvider.php index 96f882923f..0d5af2d102 100644 --- a/module/Application/test/TestConfigProvider.php +++ b/module/Application/test/TestConfigProvider.php @@ -19,7 +19,7 @@ public static function getConfig(): array /** * @throws SchemaException */ - public static function overrideConfig(ServiceManager $serviceManager) + public static function overrideConfig(ServiceManager $serviceManager): void { $testConfig = [ 'doctrine' => [ diff --git a/module/Frontpage/test/ControllerTest.php b/module/Frontpage/test/ControllerTest.php index 2f64fc5f59..b918fc6be4 100644 --- a/module/Frontpage/test/ControllerTest.php +++ b/module/Frontpage/test/ControllerTest.php @@ -8,7 +8,6 @@ class ControllerTest extends BaseControllerTest { public function testIndexActionCanBeAccessed(): void { -// $this->markTestSkipped('Decision/Mapper/Member::findBirthdayMembers is not supported by SQLite'); $this->dispatch('/'); $this->assertResponseStatusCode(200); }