Skip to content

Commit

Permalink
Merge pull request #8038 from kenjis/fix-RoutesTest-testRoutesCommand…
Browse files Browse the repository at this point in the history
…RouteLegacy

test: fix incorrect testRoutesCommandRouteLegacy
  • Loading branch information
kenjis authored Oct 12, 2023
2 parents 7869d35 + 484cbe5 commit f6ce13b
Showing 1 changed file with 18 additions and 36 deletions.
54 changes: 18 additions & 36 deletions tests/system/Commands/RoutesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,46 +198,28 @@ public function testRoutesCommandRouteLegacy(): void
$routes->loadRoutes();

$routes->setAutoRoute(true);
$namespace = 'Tests\Support\Controllers';
$routes->setDefaultNamespace($namespace);

command('routes');

$expected = <<<'EOL'
+---------+-------------------------------+---------------+-----------------------------------------------------+----------------+---------------+
| Method | Route | Name | Handler | Before Filters | After Filters |
+---------+-------------------------------+---------------+-----------------------------------------------------+----------------+---------------+
| GET | / | » | \App\Controllers\Home::index | | toolbar |
| GET | closure | » | (Closure) | | toolbar |
| GET | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| HEAD | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| POST | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| PUT | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| DELETE | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| CLI | testing | testing-index | \App\Controllers\TestController::index | | |
| auto | hello | | \Tests\Support\Controllers\Hello::index | | toolbar |
| auto | hello/index[/...] | | \Tests\Support\Controllers\Hello::index | | toolbar |
| auto | newautorouting/getIndex[/...] | | \Tests\Support\Controllers\Newautorouting::getIndex | | toolbar |
| auto | newautorouting/postSave[/...] | | \Tests\Support\Controllers\Newautorouting::postSave | | toolbar |
| auto | popcorn | | \Tests\Support\Controllers\Popcorn::index | | toolbar |
| auto | popcorn/index[/...] | | \Tests\Support\Controllers\Popcorn::index | | toolbar |
| auto | popcorn/pop[/...] | | \Tests\Support\Controllers\Popcorn::pop | | toolbar |
| auto | popcorn/popper[/...] | | \Tests\Support\Controllers\Popcorn::popper | | toolbar |
| auto | popcorn/weasel[/...] | | \Tests\Support\Controllers\Popcorn::weasel | | toolbar |
| auto | popcorn/oops[/...] | | \Tests\Support\Controllers\Popcorn::oops | | toolbar |
| auto | popcorn/goaway[/...] | | \Tests\Support\Controllers\Popcorn::goaway | | toolbar |
| auto | popcorn/index3[/...] | | \Tests\Support\Controllers\Popcorn::index3 | | toolbar |
| auto | popcorn/canyon[/...] | | \Tests\Support\Controllers\Popcorn::canyon | | toolbar |
| auto | popcorn/cat[/...] | | \Tests\Support\Controllers\Popcorn::cat | | toolbar |
| auto | popcorn/json[/...] | | \Tests\Support\Controllers\Popcorn::json | | toolbar |
| auto | popcorn/xml[/...] | | \Tests\Support\Controllers\Popcorn::xml | | toolbar |
| auto | popcorn/toindex[/...] | | \Tests\Support\Controllers\Popcorn::toindex | | toolbar |
| auto | popcorn/echoJson[/...] | | \Tests\Support\Controllers\Popcorn::echoJson | | toolbar |
| auto | remap[/...] | | \Tests\Support\Controllers\Remap::_remap | | toolbar |
+---------+-------------------------------+---------------+-----------------------------------------------------+----------------+---------------+
+---------+------------------+---------------+----------------------------------------+----------------+---------------+
| Method | Route | Name | Handler | Before Filters | After Filters |
+---------+------------------+---------------+----------------------------------------+----------------+---------------+
| GET | / | » | \App\Controllers\Home::index | | toolbar |
| GET | closure | » | (Closure) | | toolbar |
| GET | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| HEAD | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| POST | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| PUT | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| DELETE | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar |
| CLI | testing | testing-index | \App\Controllers\TestController::index | | |
| auto | / | | \App\Controllers\Home::index | | toolbar |
| auto | home | | \App\Controllers\Home::index | | toolbar |
| auto | home/index[/...] | | \App\Controllers\Home::index | | toolbar |
+---------+------------------+---------------+----------------------------------------+----------------+---------------+
EOL;
$this->assertStringContainsString($expected, $this->getBuffer());
}
Expand Down

0 comments on commit f6ce13b

Please sign in to comment.