1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

change test validations from strings to datetime

This commit is contained in:
fogelito 2022-07-13 16:55:57 +03:00
parent 7ab26e5b0d
commit 76b65c5dea
2 changed files with 3 additions and 3 deletions

View file

@ -824,7 +824,7 @@ App::post('/v1/projects/:projectId/keys')
->param('expire', null, new DateTimeValidation(), 'Expiration time in DateTime. Use null for unlimited expiration.', true)
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $name, array $scopes, string|null $expire, Response $response, Database $dbForConsole) {
->action(function (string $projectId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) {
$project = $dbForConsole->getDocument('projects', $projectId);
@ -934,7 +934,7 @@ App::put('/v1/projects/:projectId/keys/:keyId')
->param('expire', null, new DatetimeValidation(), 'Expiration time in DateTime. Use null for unlimited expiration.', true)
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $keyId, string $name, array $scopes, string|null $expire, Response $response, Database $dbForConsole) {
->action(function (string $projectId, string $keyId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) {
$project = $dbForConsole->getDocument('projects', $projectId);

View file

@ -861,7 +861,7 @@ trait WebhooksBase
$this->assertNotEmpty($webhook['data']['userId']);
$this->assertNotEmpty($webhook['data']['teamId']);
$this->assertCount(2, $webhook['data']['roles']);
$this->assertEquals(true, DateTime::isValid($webhook['data']['joined']));
$this->assertEquals(false, DateTime::isValid($webhook['data']['joined']));
$this->assertEquals(true, DateTime::isValid($webhook['data']['invited']));
$this->assertEquals(('server' === $this->getSide()), $webhook['data']['confirm']);