Files
PHP-App-Timekeeping/api/tests/_support/Helper/Api.php
T

35 lines
880 B
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 WORKING_HOURS_JSON_FORMAT = [
'date' => 'string:date',
'workingHours' => self::FORMAT_TIME,
];
const WORKING_HOURS_VIEW_JSON_FORMAT = [
"period" => "string",
"periodDesignation" => "string",
"totalHours" => self::FORMAT_TIME,
"workingDays" => 'integer:>0',
"overtime" => self::FORMAT_TIME,
];
const ERROR_JSON_FORMAT = [
"timestamp" => "string:date-time",
"status" => 0,
"error" => "string",
"message" => "string",
"path" => "string:path",
];
}