Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Test) Tests Generator #1075

Merged
merged 10 commits into from
Feb 13, 2020
Merged

(Test) Tests Generator #1075

merged 10 commits into from
Feb 13, 2020

Conversation

HDVinnie
Copy link
Collaborator

This pull request includes foundational components for testing your application by generating model factories, HTTP tests, unit tests, and test case stubs for common code paths.

Before merging, you need to:

  • Checkout the shift-22443 branch
  • Run composer install
  • Run vendor/bin/phpunit
  • Review the incomplete tests

@HDVinnie
Copy link
Collaborator Author

❌ Shift could not generate factories for the models within your application. This is likely due to a failure running php artisan migrate:fresh for your application on the Shift build server.

However, Shift added the generate:model-factory package to your composer.json development dependencies. So you can generate your model factories locally by running composer install, then php artisan generate:model-factory. Use the --force option to regenerate any partial factories added by Shift or previously created.

@HDVinnie
Copy link
Collaborator Author

⚠️ Shift found 34 undefined actions - the routes were defined, but did not have code for the controller action. If these are missing, you should define them. Otherwise, you should remove the route.

  • App\Http\Controllers\API\ChatController@changeChatroom
  • App\Http\Controllers\API\ChatController@fetchChatrooms
  • App\Http\Controllers\API\ChatController@fetchMessages
  • App\Http\Controllers\API\ChatController@index
  • App\Http\Controllers\API\ChatController@sendMessage
  • App\Http\Controllers\RequestController@addRequest
  • App\Http\Controllers\RequestController@editRequest
  • App\Http\Controllers\SeedboxController@destroy
  • App\Http\Controllers\SeedboxController@store
  • App\Http\Controllers\Staff\CommandController@clearCompiled
  • App\Http\Controllers\Staff\UserController@destroy
  • App\Http\Controllers\Staff\UserController@password
  • App\Http\Controllers\TorrentController@feedize
  • App\Http\Controllers\UserController@activate
  • App\Http\Controllers\UserController@changeAbout
  • App\Http\Controllers\UserController@changeAccountNotification
  • App\Http\Controllers\UserController@changeAchievement
  • App\Http\Controllers\UserController@changeBonNotification
  • App\Http\Controllers\UserController@changeEmail
  • App\Http\Controllers\UserController@changeFollower
  • App\Http\Controllers\UserController@changeFollowingNotification
  • App\Http\Controllers\UserController@changeForum
  • App\Http\Controllers\UserController@changeForumNotification
  • App\Http\Controllers\UserController@changeMentionNotification
  • App\Http\Controllers\UserController@changeOther
  • App\Http\Controllers\UserController@changePassword
  • App\Http\Controllers\UserController@changeProfile
  • App\Http\Controllers\UserController@changeRequest
  • App\Http\Controllers\UserController@changeRequestNotification
  • App\Http\Controllers\UserController@changeSubscriptionNotification
  • App\Http\Controllers\UserController@changeTitle
  • App\Http\Controllers\UserController@changeTorrent
  • App\Http\Controllers\UserController@changeTorrentNotification
  • App\Http\Controllers\UserController@changeTwoStep

@HDVinnie
Copy link
Collaborator Author

ℹ️ Using your routes, Shift generated tests for 75 Controllers. While test cases were stubbed using the route properties, they are marked as incomplete for you to review and complete by adding any remaining setup and assertions. Review the documentation on HTTP Tests for additional assertions.

@HDVinnie
Copy link
Collaborator Author

ℹ️ Shift generated tests for 2 Form Requests. While test cases were stubbed using the command name, they are marked as incomplete for you to review and complete by adding any remaining setup and assertions. Review may use this alternative Form Request testing strategy as a guide.

@HDVinnie
Copy link
Collaborator Author

ℹ️ Shift generated tests for 28 Commands. While test cases were stubbed using the command name, they are marked as incomplete for you to review and complete by adding any remaining setup and assertions. Review the documentation on Console Tests for additional reference.

@HDVinnie
Copy link
Collaborator Author

ℹ️ Shift set some basic testing configuration values in your phpunit.xml file. Depending on your application, you may need to adjust these.

For example, the database was configured to use SQLite. However, your application may depend on a specific database. As such, you will want to set up and configure an equivalent database for testing.

@HDVinnie
Copy link
Collaborator Author

ℹ️ If you are using Laravel Telescope you may need to temporarily disable Telescope while reviewing these generated tests. You may do so by setting the TELESCOPE_ENABLED=false environment variable or in your phpunit.xml file.

@HDVinnie
Copy link
Collaborator Author

⚗️ This Shift pairs with the new Confident Laravel video course. If you are getting started with testing Laravel applications, it will guide you step-by-step from writing your first test to a confidently tested Laravel application.

@HDVinnie HDVinnie changed the title Tests Generator (Test) Tests Generator Feb 12, 2020
@HDVinnie HDVinnie merged commit 3d1305d into master Feb 13, 2020
@HDVinnie HDVinnie removed the WIP label Feb 13, 2020
@HDVinnie HDVinnie deleted the shift-22443 branch February 14, 2020 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants