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

Tests Generator #5

Merged
merged 6 commits into from
Aug 25, 2022
Merged

Tests Generator #5

merged 6 commits into from
Aug 25, 2022

Conversation

KalimeroMK
Copy link
Owner

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-69376 branch
  • Review all pull request comments for additional changes
  • Run composer update
  • Run vendor/bin/phpunit
  • Review the incomplete tests

@KalimeroMK
Copy link
Owner Author

⚠️ Shift could not verify the following core testing files since they differed from the default Laravel version. You should compare these files against the Laravel 9.0 versions to review any differences:

  • tests/CreatesApplication.php

@KalimeroMK
Copy link
Owner Author

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

Shift added a factory generator package as a development dependency so you may generate your model factories locally.

To do so, run php artisan generate:factory. You may use the --force option to regenerate any partial factories added by Shift or pass the model name to regenerate a specific factory.

@KalimeroMK
Copy link
Owner Author

⚠️ Shift found 33 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\Auth\AuthController@logout
  • Modules\Admin\Http\Controllers\AdminController@profile
  • Modules\Admin\Http\Controllers\AdminController@profileUpdate
  • Modules\Banner\Http\Controllers\BannerController@show
  • Modules\Billing\Http\Controllers\Api\StripeController@destroy
  • Modules\Billing\Http\Controllers\Api\StripeController@index
  • Modules\Billing\Http\Controllers\Api\StripeController@show
  • Modules\Billing\Http\Controllers\Api\StripeController@store
  • Modules\Billing\Http\Controllers\Api\StripeController@update
  • Modules\Brand\Http\Controllers\BrandController@show
  • Modules\Cart\Http\Controllers\CartController@index
  • Modules\Category\Http\Controllers\CategoryController@show
  • Modules\Core\Http\Controllers\CoreController@index
  • Modules\Coupon\Http\Controllers\CouponController@show
  • Modules\Message\Http\Controllers\MessageController@create
  • Modules\Message\Http\Controllers\MessageController@edit
  • Modules\Message\Http\Controllers\MessageController@store
  • Modules\Message\Http\Controllers\MessageController@update
  • Modules\Newsletter\Http\Controllers\NewsletterController@show
  • Modules\Post\Http\Controllers\PostCommentController@create
  • Modules\Post\Http\Controllers\PostCommentController@show
  • Modules\Post\Http\Controllers\PostController@show
  • Modules\Product\Http\Controllers\ProductController@show
  • Modules\Product\Http\Controllers\ProductReviewController@create
  • Modules\Product\Http\Controllers\ProductReviewController@show
  • Modules\Settings\Http\Controllers\SettingsController@create
  • Modules\Settings\Http\Controllers\SettingsController@destroy
  • Modules\Settings\Http\Controllers\SettingsController@edit
  • Modules\Settings\Http\Controllers\SettingsController@show
  • Modules\Settings\Http\Controllers\SettingsController@store
  • Modules\Settings\Http\Controllers\SettingsController@update
  • Modules\Shipping\Http\Controllers\ShippingController@show
  • Modules\Tag\Http\Controllers\TagController@show

@KalimeroMK
Copy link
Owner Author

ℹ️ Using your routes, Shift generated tests for 39 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.

@KalimeroMK
Copy link
Owner Author

ℹ️ Shift generated tests for 1 Form Request. 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.

@KalimeroMK
Copy link
Owner Author

ℹ️ Shift generated tests for 1 Command. 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.

@KalimeroMK
Copy link
Owner 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.

Shift also changed any <server> configuration elements to <env> elements to address configuration precedence.

@KalimeroMK
Copy link
Owner 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.

@KalimeroMK
Copy link
Owner 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.

@KalimeroMK
Copy link
Owner Author

ℹ️ Shift detected your project does not have any CI jobs. You may quickly create jobs to automatically lint PHP, check code style, and run tests with the CI Generator.

@KalimeroMK KalimeroMK merged commit 79ccf3c into main Aug 25, 2022
@KalimeroMK KalimeroMK deleted the shift-69376 branch August 26, 2022 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants