Skip to content

Commit

Permalink
[8.x] Use improved syntax for caching route. (#35507)
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Dec 6, 2020
1 parent 2d88c39 commit c007d7c
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions tests/Integration/Routing/ImplicitRouteBindingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,15 @@ protected function defineDatabaseMigrations(): void

public function testWithRouteCachingEnabled()
{
$route = <<<PHP
$this->defineCacheRoutes(<<<PHP
<?php
use Illuminate\Tests\Integration\Routing\ImplicitBindingModel;
Route::post('/user/{user}', function (ImplicitBindingModel \$user) {
return \$user;
})->middleware('web');
PHP;

file_put_contents(base_path('routes/testbench.php'), $route);

$this->artisan('route:cache')->run();

$this->reloadApplication();

$this->assertFilenameExists('bootstrap/cache/routes-v7.php');

$this->requireApplicationCachedRoutes();
PHP);

$user = ImplicitBindingModel::create(['name' => 'Dries']);

Expand All @@ -82,8 +72,6 @@ public function testWithRouteCachingEnabled()
'id' => $user->id,
'name' => $user->name,
]);

$this->artisan('route:clear')->run();
}
}

Expand Down

0 comments on commit c007d7c

Please sign in to comment.