Using Datasets
We noticed that a lot of the lines of code in the tests in RouterTest were duplicates of each other.
Let me show you how we can reduce the tests down to one test by using datasets instead of duplicate code. If you've done my Testing PHP course then you'll know about data-providers. Well datasets do the same thing...they just pass different sets of data to the same test in an iterative way.
So we can use the same test to test all different outcomes / expectations. Great!
Branch: https://github.com/GaryClarke/pest-tdd/tree/29-using-datasets
0 comments