Skip to content

Commit bea244b

Browse files
committed
add some more test cases
1 parent 7fd5e77 commit bea244b

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace WonderNetwork\SlimKernel\Http\Serializer;
6+
7+
final class BooleansInput {
8+
public bool $true;
9+
public bool $false;
10+
public bool $one;
11+
public bool $zero;
12+
}

tests/Http/Serializer/DeserializeParameterResolverTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ public function testDeserialize(): void {
3030
];
3131
$get = [
3232
'page' => 3,
33+
'lists' => ['alpha', 'bravo'],
34+
'arrays' => ['charlie' => 'delta'],
35+
'booleans' => [
36+
'true' => true,
37+
'false' => false,
38+
'one' => 1,
39+
'zero' => 0,
40+
],
3341
];
3442

3543
$request = (new ServerRequestFactory())

tests/Http/Serializer/SampleGetInput.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,13 @@
66
final class SampleGetInput {
77
public int $page = 1;
88
public int $perPage = 100;
9+
/**
10+
* @var string[]
11+
*/
12+
public array $lists;
13+
/**
14+
* @var array<string, string>
15+
*/
16+
public array $arrays;
17+
public BooleansInput $booleans;
918
}

0 commit comments

Comments
 (0)