Skip to content

Commit

Permalink
add test for array actions within namespaced groups
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Oct 11, 2020
1 parent c52adf4 commit 98837ce
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/Routing/RouteRegistrarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,25 @@ public function testCanRegisterRouteWithControllerActionArray()
$this->seeMiddleware('controller-middleware');
}

public function testCanRegisterNamespacedGroupRouteWithControllerActionArray()
{
$this->router->group(['namespace' => 'WhatEver'], function () {
$this->router->middleware('controller-middleware')
->get('users', [RouteRegistrarControllerStub::class, 'index']);
});

$this->seeResponse('controller', Request::create('users', 'GET'));
$this->seeMiddleware('controller-middleware');

$this->router->group(['namespace' => 'WhatEver'], function () {
$this->router->middleware('controller-middleware')
->get('users', ['\\'.RouteRegistrarControllerStub::class, 'index']);
});

$this->seeResponse('controller', Request::create('users', 'GET'));
$this->seeMiddleware('controller-middleware');
}

public function testCanRegisterRouteWithArrayAndControllerAction()
{
$this->router->middleware('controller-middleware')->put('users', [
Expand Down

0 comments on commit 98837ce

Please sign in to comment.