File tree 2 files changed +4
-2
lines changed
tests/Unit/Laravel/Middleware
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ private function getParameters(Route|null $route): array
66
66
$ route ?->signatureParameters(['subClass ' => UnitEnum::class])
67
67
)->mapWithKeys (
68
68
function (ReflectionParameter $ parameter ) {
69
- $ backedEnumClass = rtrim ((string )$ parameter ->getType (), '? ' );
69
+ $ backedEnumClass = ltrim ((string )$ parameter ->getType (), '? ' );
70
70
71
71
if (enum_exists ($ backedEnumClass )) {
72
72
return [$ parameter ->getName () => new ReflectionEnum ($ backedEnumClass )];
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ function (SimpleEnum $status) {
59
59
60
60
$ router ->get ('/optional/{status?} ' ,
61
61
function (SimpleEnum $ status = null ) {
62
+ return $ status ?->name;
62
63
}
63
64
);
64
65
@@ -83,7 +84,8 @@ public function testShouldBindBasicEnum()
83
84
84
85
public function testShouldBindBasicEnumOptionally ()
85
86
{
86
- $ this ->get ('/optional/ ' )->assertOk ();
87
+ // $this->get('/optional/')->assertOk()->assertSee('');
88
+ $ this ->get ('/optional/open ' )->assertOk ()->assertSee ('Open ' );
87
89
}
88
90
89
91
public function testShouldBindBasicEnumWithDefault ()
You can’t perform that action at this time.
0 commit comments