joshgaber / NovaUnit

Unit testing suite for Laravel Nova, built to extend PHPUnit
https://joshgaber.github.io/NovaUnit
MIT License
66 stars 23 forks source link

Use ForwardCalls trait to mock the action instead of manual MockAction #41

Closed rakishii13 closed 2 years ago

rakishii13 commented 3 years ago

Is there a way we can switch to use the trait ForwardCalls to actually mock the action being tested instead of setting up an entire MockAction and only handling the handle() method. Using the trait, we instead just pass through and that way can access more methods and variables inside the action for better testing.

rakishii13 commented 3 years ago

+1

joshgaber commented 2 years ago

Hello, and thank you for your suggestion. I'm sorry for not responding to you sooner, but I wanted to take the time now in case you are still curious about this.

I never considered using ForwardCalls, but it's an interesting idea. I will try it out and see if it makes sense, but if you would like to provide a sample yourself, you're welcome to fork this repository and submit a pull request.

joshgaber commented 2 years ago

Closing due to inactivity