Explore using the PHPUnit Command Line Runner to filter your unit tests when running tests to improve your speed of writing your software and running the tests.
- [Narrator] If you were paying attention…when we were running our tests in the prior video,…you would have caught that all of our tests were running.…Take a look at the test being run.…Again, if we run the command…$vendor/bin/phpunit tests…we'll see that this executes all of the tests in our code.…This isn't too bad, since we only have one test file,…and two actual tests.…At only 60 milliseconds, the tests are pretty fast…for us to just keep running and running.…What happens, however, when we have entire application…with hundreds or thousands…of files and corresponding tests?…Now we are talking a project with a lot of tests…and way too much time would be spent not getting feedback…on our single test class and method…for us to really perform TDD.…
Luckily, the developers of PHPUnit gave us…some powerful filtering abilities for our tests.…The simplest one is the one that we've already been doing.…We can filter by directory or a file.…That's the test parameter we keep passing…in our PHPUnit command line interface.…
- Why use unit testing?
- Writing unit tests
- Extending unit tests
- Filtering PHPUnit tests
- Building dummy objects
- Working with data providers
- Writing an exception-based test
- Using TDD tactics
- Using PHPUnit advanced tactics, such as database tests
Skill Level Intermediate
PHP: Managing Persistent Sessionswith David Powers2h 41m Intermediate
1. The Basics of Test-Driven Development
2. Advanced Test-Driven Development
3. Test-Driven Development Tactics
4. PHPUnit Advanced Tactics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.