Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Nov 3, 2023
1 parent 3694008 commit bf700de
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,18 @@ public function testDisableMiddlewareAfterGetEnabledMiddlewares(): void
);
}

public function testGetEnabledMiddlewaresTwice(): void
{
$route = Route::get('/')
->middleware(TestMiddleware1::class, TestMiddleware2::class);

$result1 = $route->getData('enabledMiddlewares');
$result2 = $route->getData('enabledMiddlewares');

$this->assertSame([TestMiddleware1::class, TestMiddleware2::class], $result1);
$this->assertSame($result1, $result2);
}

public function testMiddlewaresWithKeys(): void
{
$route = Route::get('/')
Expand Down

0 comments on commit bf700de

Please sign in to comment.