Skip to content

Commit 4c35d6a

Browse files
committed
test: improve test compatibility
1 parent 0baced3 commit 4c35d6a

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

tests/RouteTest.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ public function it_can_register_a_post_route(): void
164164
->method('post')
165165
->register();
166166

167-
foreach ($routes as $route) {
167+
foreach (locales() as $locale) {
168168
$this->assertContains(
169169
'POST',
170-
$route->methods
170+
$routes->getByName("{$locale}.test")->methods
171171
);
172172
}
173173
}
@@ -532,10 +532,16 @@ public function the_default_home_page_can_be_registered_without_prefix(): void
532532
/** @test **/
533533
public function a_route_can_be_registered_with_a_middleware(): void
534534
{
535-
Route::multilingual('/')->middleware('web');
535+
$routes = Route::multilingual('/')
536+
->middleware('web')
537+
->name('home')
538+
->register();
536539

537-
foreach (Route::getRoutes() as $route) {
538-
$this->assertContains('web', data_get($route, 'action.middleware'));
540+
foreach (locales() as $locale) {
541+
$this->assertContains(
542+
'web',
543+
data_get($routes->getByName("{$locale}.home"), 'action.middleware')
544+
);
539545
}
540546
}
541547

0 commit comments

Comments
 (0)