Skip to content

Commit 5494860

Browse files
committed
added more tests
1 parent 566ccb3 commit 5494860

3 files changed

Lines changed: 75 additions & 1 deletion

File tree

app/V1Module/presenters/RegistrationPresenter.php

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public function actionAcceptInvitation()
415415
);
416416
}
417417

418-
/**
418+
/**
419419
* Endpoint for performance testing.
420420
* @POST
421421
* @param int $a
@@ -428,4 +428,50 @@ public function actionTestLoose(int $a, ?string $email)
428428
{
429429
$this->sendSuccessResponse("OK");
430430
}
431+
432+
433+
/**
434+
* Endpoint for performance testing.
435+
* @POST
436+
* @param string $a
437+
* @param string $b
438+
* @param ?string $c
439+
* @param ?string $d
440+
* @param ?string $e
441+
* @throws BadRequestException
442+
* @throws InvalidArgumentException
443+
*/
444+
public function actionTest5UrlLoose(string $a, string $b, ?string $c, ?string $d, ?string $e)
445+
{
446+
$this->sendSuccessResponse("OK");
447+
}
448+
449+
/**
450+
* Endpoint for performance testing.
451+
* @POST
452+
* @Param(type="post", name="a", validation="string")
453+
* @Param(type="post", name="b", validation="string")
454+
* @Param(type="post", name="c", validation="string")
455+
* @Param(type="post", name="d", validation="string")
456+
* @Param(type="post", name="e", validation="string")
457+
* @throws BadRequestException
458+
* @throws InvalidArgumentException
459+
*/
460+
public function actionTest5BodyLoose()
461+
{
462+
$this->sendSuccessResponse("OK");
463+
}
464+
465+
/**
466+
* Endpoint for performance testing.
467+
* @POST
468+
* @Param(type="post", name="a", validation="string")
469+
* @Param(type="post", name="nested")
470+
* @throws BadRequestException
471+
* @throws InvalidArgumentException
472+
*/
473+
public function actionTest5BodyLooseNested()
474+
{
475+
$this->sendSuccessResponse("OK");
476+
}
431477
}

app/V1Module/router/RouterFactory.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ private static function createUsersRoutes(string $prefix): RouteList
479479
$router[] = new GetRoute("$prefix/ical/<id>", "UserCalendars:");
480480
$router[] = new DeleteRoute("$prefix/ical/<id>", "UserCalendars:expireCalendar");
481481
$router[] = new PostRoute("$prefix/testLoose/<a>", "Registration:testLoose");
482+
$router[] = new PostRoute("$prefix/test5UrlLoose/<a>/<b>", "Registration:test5UrlLoose");
483+
$router[] = new PostRoute("$prefix/test5BodyLoose", "Registration:test5BodyLoose");
484+
$router[] = new PostRoute("$prefix/test5BodyLooseNested", "Registration:test5BodyLooseNested");
482485
$router[] = new PostRoute("$prefix/invite", "Registration:createInvitation");
483486
$router[] = new PostRoute("$prefix/accept-invitation", "Registration:acceptInvitation");
484487

performance-test.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,31 @@ public function __construct()
2626
params: ["action" => "testLoose", "a" => "1", "b" => "a@a.a"],
2727
post: ["c" => 1.1]
2828
),
29+
"5UrlLoose" => new Request(
30+
"name",
31+
method: "POST",
32+
params: ["action" => "test5UrlLoose", "a" => "a", "b" => "b", "c" => "c", "d" => "d", "e" => "e"],
33+
),
34+
"5BodyLoose" => new Request(
35+
"name",
36+
method: "POST",
37+
params: ["action" => "test5BodyLoose"],
38+
post: ["a" => "a", "b" => "b", "c" => "c", "d" => "d", "e" => "e"]
39+
),
40+
"5BodyLooseNested" => new Request(
41+
"name",
42+
method: "POST",
43+
params: ["action" => "test5BodyLooseNested"],
44+
post: ["a" => "a", "nested" => [
45+
"b" => "b", "nested" => [
46+
"c" => "c", "nested" => [
47+
"d" => "d", "nested" => [
48+
"e" => "e"
49+
]
50+
]
51+
]
52+
]]
53+
),
2954
];
3055
}
3156

0 commit comments

Comments
 (0)