wantTo('generate RESTful routes for a resource with default controller'); $I->runShellCommand('php artisan wn:route project-type'); $I->seeInShellOutput('project-type routes generated'); $I->openFile('./app/Http/routes.php'); $I->seeInThisFile(" \$app->get('project-type', 'ProjectTypesController@all'); \$app->get('project-type/{id}', 'ProjectTypesController@get'); \$app->post('project-type', 'ProjectTypesController@add'); \$app->put('project-type/{id}', 'ProjectTypesController@put'); \$app->delete('project-type/{id}', 'ProjectTypesController@remove'); "); $I->writeToFile('./app/Http/routes.php', 'get("/", function () use ($app) { return $app->welcome(); }); '); $I->wantTo('generate RESTful routes for a resource with custom controller'); $I->runShellCommand('php artisan wn:route foo --controller=customController'); $I->seeInShellOutput('foo routes generated'); $I->openFile('./app/Http/routes.php'); $I->seeInThisFile(" \$app->get('foo', 'customController@all'); \$app->get('foo/{id}', 'customController@get'); \$app->post('foo', 'customController@add'); \$app->put('foo/{id}', 'customController@put'); \$app->delete('foo/{id}', 'customController@remove'); "); $I->writeToFile('./app/Http/routes.php', 'get("/", function () use ($app) { return $app->welcome(); }); '); $I->wantTo('run wn:routes in Lumen 5.3+'); mkdir('./routes'); $I->writeToFile('./routes/web.php', 'get("/", function () use ($app) { return $app->version(); }); '); $I->runShellCommand('php artisan wn:route foo --controller=customController'); $I->seeInShellOutput('foo routes generated'); $I->openFile('./routes/web.php'); $I->seeInThisFile(" \$app->get('foo', 'customController@all'); \$app->get('foo/{id}', 'customController@get'); \$app->post('foo', 'customController@add'); \$app->put('foo/{id}', 'customController@put'); \$app->delete('foo/{id}', 'customController@remove'); "); $I->deleteDir('./routes');