wantTo('generate a RESTful controller with short model name'); $I->runShellCommand('php artisan wn:controller Test --no-routes'); $I->seeInShellOutput('TestsController generated'); $I->seeFileFound('./app/Http/Controllers/TestsController.php'); $I->openFile('./app/Http/Controllers/TestsController.php'); $I->seeFileContentsEqual('deleteFile('./app/Http/Controllers/TestsController.php'); $I->wantTo('generate a RESTful controller with full model name and routes'); $I->runShellCommand('php artisan wn:controller "App\Models\Category"'); $I->seeInShellOutput('CategoriesController generated'); $I->seeFileFound('./app/Http/Controllers/CategoriesController.php'); $I->openFile('./app/Http/Controllers/CategoriesController.php'); $I->seeFileContentsEqual('deleteFile('./app/Http/Controllers/CategoriesController.php'); $I->openFile('./app/Http/routes.php'); $I->seeInThisFile(" \$app->get('category', 'CategoriesController@all'); \$app->get('category/{id}', 'CategoriesController@get'); \$app->post('category', 'CategoriesController@add'); \$app->put('category/{id}', 'CategoriesController@put'); \$app->delete('category/{id}', 'CategoriesController@remove'); "); $I->writeToFile('./app/Http/routes.php', 'get("/", function () use ($app) { return $app->welcome(); }); ');