refactor/update #30
+1
-1
@@ -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']);
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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<array{string, string, int, DateTime}>
|
||||
* @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'))],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user