From b4de11725cc1e4157938864961deeaa889b54d46 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 24 Nov 2020 16:29:10 +0100 Subject: [PATCH] Add test for implicit binding (#35346) --- tests/Routing/ImplicitRouteBindingTest.php | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/Routing/ImplicitRouteBindingTest.php diff --git a/tests/Routing/ImplicitRouteBindingTest.php b/tests/Routing/ImplicitRouteBindingTest.php new file mode 100644 index 000000000000..81b536f44d56 --- /dev/null +++ b/tests/Routing/ImplicitRouteBindingTest.php @@ -0,0 +1,35 @@ + function (ImplicitRouteBindingUser $user) { + return $user; + }]; + + $route = new Route('GET', '/test', $action); + $route->parameters = ['user' => new ImplicitRouteBindingUser]; + + $route->prepareForSerialization(); + + $container = Container::getInstance(); + + ImplicitRouteBinding::resolveForRoute($container, $route); + + $this->assertTrue(true); + } +} + +class ImplicitRouteBindingUser extends Model +{ + // +}