diff --git a/api/html/index.php b/api/html/index.php index cbd9aca..addc91c 100644 --- a/api/html/index.php +++ b/api/html/index.php @@ -17,7 +17,7 @@ use TorstenHettstedt\TimekeepingApi\Middleware\OriginAccessControlHandler; $container = new Container(); $container->set('databases', function () { - $dsn = "pgsql:host=${_ENV['DATABASES_HOST']};port=5432;dbname=${_ENV['DATABASES_NAME']}"; + $dsn = "pgsql:host={$_ENV['DATABASES_HOST']};port=5432;dbname={$_ENV['DATABASES_NAME']}"; return new PDO($dsn, $_ENV['DATABASES_USER'], $_ENV['DATABASES_PASS']); }); diff --git a/api/tests/unit/Controller/WorkingHoursControllerTest.php b/api/tests/unit/Controller/WorkingHoursControllerTest.php index a9a3167..17ff3b8 100644 --- a/api/tests/unit/Controller/WorkingHoursControllerTest.php +++ b/api/tests/unit/Controller/WorkingHoursControllerTest.php @@ -19,11 +19,11 @@ use TorstenHettstedt\TimekeepingApi\Controller\WorkingHoursController; class WorkingHoursControllerTest extends AbstractControllerTest { - protected const FICTIONAL_STATUS_CODE = 666; - public const EXISTING_DATE = '2020-01-28'; - public const EXISTING_INTERVAL = '07:20:00'; - public const NEW_DATE = '2020-04-01'; - public const NEW_INTERVAL = '07:59:00'; + protected const int FICTIONAL_STATUS_CODE = 666; + public const string EXISTING_DATE = '2020-01-28'; + public const string EXISTING_INTERVAL = '07:20:00'; + public const string NEW_DATE = '2020-04-01'; + public const string NEW_INTERVAL = '07:59:00'; protected ContainerInterface $container; protected Request $request; diff --git a/api/tests/unit/Repositories/WorkingHoursRepositoryTest.php b/api/tests/unit/Repositories/WorkingHoursRepositoryTest.php index 0dbef52..326caff 100644 --- a/api/tests/unit/Repositories/WorkingHoursRepositoryTest.php +++ b/api/tests/unit/Repositories/WorkingHoursRepositoryTest.php @@ -18,11 +18,11 @@ use TorstenHettstedt\TimekeepingApi\Repositories\WorkingHoursRepository; class WorkingHoursRepositoryTest extends Unit { - public const EXISTING_DATE = '2020-01-28'; - public const EXISTING_INTERVAL = 'PT7H20M'; - public const NEW_DATE = '2020-04-01'; - public const NEW_INTERVAL = 'PT7H59M'; - public const RECORDS_COUNT = 61; + public const string EXISTING_DATE = '2020-01-28'; + public const string EXISTING_INTERVAL = 'PT7H20M'; + public const string NEW_DATE = '2020-04-01'; + public const string NEW_INTERVAL = 'PT7H59M'; + public const int RECORDS_COUNT = 61; protected PDO $pdoObject; diff --git a/api/tests/unit/Repositories/WorkingHoursViewRepositoryTest.php b/api/tests/unit/Repositories/WorkingHoursViewRepositoryTest.php index 8211985..14ebb54 100644 --- a/api/tests/unit/Repositories/WorkingHoursViewRepositoryTest.php +++ b/api/tests/unit/Repositories/WorkingHoursViewRepositoryTest.php @@ -6,7 +6,6 @@ use Codeception\Attribute\DataProvider; use Codeception\Test\Unit; use DateTime; use DateTimeZone; -use Exception; use PDO;use TorstenHettstedt\TimekeepingApi\Models\WorkingHoursView; use TorstenHettstedt\TimekeepingApi\Repositories\RepositoryRecordNotFoundException; use TorstenHettstedt\TimekeepingApi\Repositories\WorkingHoursWeeklyViewRepository; @@ -38,14 +37,13 @@ class WorkingHoursViewRepositoryTest extends Unit /** * @return array - * @throws Exception */ public function existingObjectProvider(): array { return [ - [WorkingHoursYearlyViewRepository::class, '2020', 61, new DateTime('2020-01-01', new DateTimeZone('UCT'))], - [WorkingHoursMonthlyViewRepository::class, '2020 February', 20, new DateTime('2020-02-01', new DateTimeZone('UCT'))], - [WorkingHoursWeeklyViewRepository::class, '2020#03', 5, new DateTime('2020-01-13', new DateTimeZone('UCT'))], + [WorkingHoursYearlyViewRepository::class, '2020', 61, date_create('2020-01-01', new DateTimeZone('UCT'))], + [WorkingHoursMonthlyViewRepository::class, '2020 February', 20, date_create('2020-02-01', new DateTimeZone('UCT'))], + [WorkingHoursWeeklyViewRepository::class, '2020#03', 5, date_create('2020-01-13', new DateTimeZone('UCT'))], ]; }