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

[10.x] Add --test and --pest options to make:component #47894

Merged

Conversation

nshiro
Copy link
Contributor

@nshiro nshiro commented Jul 30, 2023

In #38997, Luke added the --test and --pest options to various make commands.

This PR extends it to the make:component command as well.
All we need to do is just import the CreatesMatchingTest trait.

Example

php artisan make:component Foo --test

   INFO  Component and test [app/View/Components/Foo.php] created successfully.

In the above example, the test file is created at tests/Feature/View/Components/FooTest.php.

If we add the --view option which only creates an anonymous component, the test file will not be created. But I think that's fair enough.

Example

php artisan make:component Bar --view --test

   INFO  Component created successfully.

@taylorotwell taylorotwell merged commit c13e443 into laravel:10.x Jul 31, 2023
21 checks passed
@nshiro nshiro deleted the add_test_option_to_make_component_command branch February 15, 2024 08:58
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.

None yet

2 participants