Files
PHP-App-Timekeeping/api/tests/_support/Helper/Api.php
T
2025-06-19 14:19:09 +02:00

41 lines
1.1 KiB
PHP

<?php
namespace Helper;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
use Codeception\Module;
class Api extends Module
{
const FORMAT_TIME = 'string:regex(/\d+:[0-5]\d:[0-5]\d/)';
const FORMAT_DATE = 'string:regex(/\d{4}-\d{2}-\d{2}/)';
const WORKING_HOURS_JSON_FORMAT = [
'workingDay' => self::FORMAT_DATE,
'workingTime' => self::FORMAT_TIME,
'isHomeOffice' => 'boolean',
];
const WORKING_HOURS_VIEW_JSON_FORMAT = [
"period" => "string",
"periodDesignation" => "string",
"totalHours" => self::FORMAT_TIME,
"workingDays" => 'integer:>0',
'homeOfficeDays' => 'number:>=0',
"overtime" => self::FORMAT_TIME,
];
const ERROR_JSON_FORMAT = [
"timestamp" => "string:date",
"status" => "integer",
"error" => "string",
"message" => "string",
"path" => "string",
];
const TEST_ORIGIN = 'http://localhost:1234';
}