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

(Custom) stubs #43

Open
TeaDrinkingProgrammer opened this issue Nov 21, 2022 · 3 comments
Open

(Custom) stubs #43

TeaDrinkingProgrammer opened this issue Nov 21, 2022 · 3 comments

Comments

@TeaDrinkingProgrammer
Copy link

TeaDrinkingProgrammer commented Nov 21, 2022

I am making stubs as I want to include a copyright tag in each file and because I am migrating from PHPunit to PEST and want to change the test stubs to use PEST. I have made stubs in the stubs directory and Artisan recognises them but Lucid doesn't (E.G model.stub). I have looked into the source code and see that Lucid only reads its own stubs, could it be changed so that it also reads from the stubs folder?

@TeaDrinkingProgrammer TeaDrinkingProgrammer changed the title Stubs (Custom) stubs Nov 21, 2022
@Mulkave
Copy link
Member

Mulkave commented Nov 24, 2022

Interesting case, i never thought nor needed to have a custom at the application level but your case is totally legit.

It would be beneficial to your case to have a --stub command argument that specifies a custom location for a stub file. Would you be up for a PR with that change?

@TeaDrinkingProgrammer
Copy link
Author

That would be helpful, although I think it would be better if Lucid would mimic Laravel. In other words: look for custom stubs in the stubs folder at the root, if that does not exist, use the default models.

The only change that would have to happen is for Lucid to refactor the getStub methods to something like the resolveStubPath method the ModelMakeCommand in Laravel

@ksimenic
Copy link

ksimenic commented Jan 4, 2023

Specifically for this case, maybe it would be a good idea to contribute pest stubs and then make a config option where testing framework can be defined & correct stubs used based on the configuration?

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

No branches or pull requests

3 participants