Laravel Testing 08/24: Factories: create many testing records
ฝัง
- เผยแพร่เมื่อ 23 ก.ย. 2024
- Link to the full course: laraveldaily.c...
- - - - -
Support the channel by checking out my products:
- My Laravel courses: laraveldaily.c...
- Laravel QuickAdminPanel: quickadminpane...
- Livewire Kit Components: livewirekit.com
- - - - -
Other places to follow:
- My weekly Laravel newsletter: us11.campaign-...
- My personal Twitter: / povilaskorop
Thanks for your awesome tutorials. Your videos are really practical and helpful🔥
Thanks for making this.
Although it is a bit complicated for me, not being a developer, i like to see what other people are doing in the opensource-project that i am a user of, and being a tester, it is nice to see how to build tests in Laravel.
Who knows, one day, when i and one of the developers have time, i will try to sit together and contribute in some way and who knows, maybe i will even write my own test :-)
Keep up the good work!
I want to ask someting. How to test api request limit in laravel? I know, we can use throttle/ RateLimiter. But how to test it, should use loops or other best practies?
# sorry, my english is bad:v
Good question, I haven't personally tried to test it. I guess, you need to make rate limit very low, like 2 attempts per minute, then fire 3 attempts and assert that the third one gets a different HTTP status code? (429 from what I remember)
Cannot use factories inside Unit Tests because it extends \PhpUnit not \Tests