Skip to content

Commit

Permalink
Fixed remaining issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen1999 committed Dec 28, 2021
1 parent 34524ce commit 4e8253f
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 23 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion module/Activity/src/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 4 additions & 2 deletions module/Activity/test/Mapper/ActivityMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion module/Application/src/Mapper/BaseMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
EntityNotFoundException,
EntityRepository,
OptimisticLockException,
Exception\ORMException};
Exception\ORMException,
};

abstract class BaseMapper
{
Expand Down
16 changes: 9 additions & 7 deletions module/Application/test/AutomaticControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -153,7 +155,7 @@ protected function testRoutePost(string $url): void

protected function getParams(): array
{
$params = array();
$params = [];

$params['id'] = 1;
$params['appId'] = 1;
Expand Down
7 changes: 5 additions & 2 deletions module/Application/test/BaseControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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'] ?? [];
Expand Down
16 changes: 10 additions & 6 deletions module/Application/test/Mapper/BaseMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'] ?? [];
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion module/Application/test/TestConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
1 change: 0 additions & 1 deletion module/Frontpage/test/ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4e8253f

Please sign in to comment.