Skip to content

Commit c8bd59f

Browse files
[11.x] Allow BackedEnum when using fromRoute() in MakesHttpRequests (#53593)
* [11.x] Allow BackedEnum when using fromRoute in MakesHttpRequests * formatting --------- Co-authored-by: Mior Muhammad Zaki <[email protected]>
1 parent 59bf3bf commit c8bd59f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Illuminate\Foundation\Testing\Concerns;
44

5+
use BackedEnum;
56
use Illuminate\Contracts\Http\Kernel as HttpKernel;
67
use Illuminate\Cookie\CookieValuePrefix;
78
use Illuminate\Http\Request;
@@ -331,11 +332,11 @@ public function from(string $url)
331332
/**
332333
* Set the referer header and previous URL session value from a given route in order to simulate a previous request.
333334
*
334-
* @param string $name
335+
* @param \BackedEnum|string $name
335336
* @param mixed $parameters
336337
* @return $this
337338
*/
338-
public function fromRoute(string $name, $parameters = [])
339+
public function fromRoute(BackedEnum|string $name, $parameters = [])
339340
{
340341
return $this->from($this->app['url']->route($name, $parameters));
341342
}

0 commit comments

Comments
 (0)