David | Fortune Validator
getTable() on null on Pest Test
Thank you for that. I have a similar setup.
I did start with seeding which was a hassle to setup anyway with refresh database trait. But I switched to creating the explicit data per test which I prefer now as well. Appreciate the tips.
Tests are a whole new world. It is quite addictive seeing all that green passes though haha
13 replies
getTable() on null on Pest Test
So I figured out my issues.
1) needed a user as you said
BUT
2) my app service provider defines the gates and each time RefeeshDatabase was run it would loose those each test creates a user with a new permission.
Took me an age to figure it out but now I just run the gates again after every user is created per test and it’s okay. Maybe this would be easier with spaties permission package I’m not sure. I just built a light weight one myself.
13 replies
getTable() on null on Pest Test
I’ll give this a go and report back. Thanks for the tip to check. I thought I had a global user logged in but I could be wrong. Very new to tests.
Out of interest, is it advised to have a testing database rather than my local dev one ? And use the refresh database trait. ? Many thanks
13 replies
Skip View Step
sorry to hassle you again but I wanted your advice if I may:
I want to pass some data to the mount of the livewire component. would the above be the right way. It does work but again I want to make sure im doing things the right way
15 replies
Skip View Step
hmm, im getting
Filament\Actions\MountableAction::getModalContent(): Return value must be of type Illuminate\Contracts\View\View|Illuminate\Contracts\Support\Htmlable|null, string returned
on your Blade version
15 replies