From 7d09e46cc04b54b0e0ec4f2b7a7a5ede90c5aece Mon Sep 17 00:00:00 2001 From: Wietse Warendorff Date: Wed, 20 Nov 2024 08:25:58 +0100 Subject: [PATCH 1/2] [11.x] Allow BackedEnum when using fromRoute in MakesHttpRequests --- .../Foundation/Testing/Concerns/MakesHttpRequests.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php b/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php index c24799df0b45..706d61be8f89 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php +++ b/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php @@ -331,11 +331,11 @@ public function from(string $url) /** * Set the referer header and previous URL session value from a given route in order to simulate a previous request. * - * @param string $name + * @param \BackedEnum|string $name * @param mixed $parameters * @return $this */ - public function fromRoute(string $name, $parameters = []) + public function fromRoute(\BackedEnum|string $name, $parameters = []) { return $this->from($this->app['url']->route($name, $parameters)); } From d2205028572bedd567a694a8ebe2cc9f751da101 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Wed, 20 Nov 2024 15:33:07 +0800 Subject: [PATCH 2/2] formatting --- .../Foundation/Testing/Concerns/MakesHttpRequests.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php b/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php index 706d61be8f89..8ecc6a784e1c 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php +++ b/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php @@ -2,6 +2,7 @@ namespace Illuminate\Foundation\Testing\Concerns; +use BackedEnum; use Illuminate\Contracts\Http\Kernel as HttpKernel; use Illuminate\Cookie\CookieValuePrefix; use Illuminate\Http\Request; @@ -335,7 +336,7 @@ public function from(string $url) * @param mixed $parameters * @return $this */ - public function fromRoute(\BackedEnum|string $name, $parameters = []) + public function fromRoute(BackedEnum|string $name, $parameters = []) { return $this->from($this->app['url']->route($name, $parameters)); }