PHPUnit: Unit Testing with a Bite!
Become a super-hero in unit testing with PHPUnit! Learn test doubles, handling exceptions, and Test-Driven-Development.
- 1841 students
- EN/ES Captions
- EN/ES Script
- Certificate of Completion
Your Guides
About this course
Wait, someone built ANOTHER dinosaur park with ZERO tests!?!? I've seen this movie before and it's up to us: to add a rich set of tests before the dinos come for us...
But seriously: testing is great. It's not only a tool for preventing bugs, it's also a development philosophy that can help you write code that's more focused on what you actually want to build.
In this tutorial, we'll get you to super-hero status of unit testing, including:
- Basic unit testing
- Test-Driven-Development: how to do it, when to do it!
- Using data providers to run tests over and over again with different input
- Mocking and test doubles! Creating mocks in PHPUnit
- The PHPUnit executable and configuration
- Testing for exceptions
What about "integration" and "functional" testing? Stay tuned for the next tutorials in this series!
Next courses in the Testing: Beginner Testing section of the Testing Track!
8 Comments
Hey Vincent-amstz,
No plans to update the Behat course soon, though we recently added a lot of notes to it to make it work on Symfony 5. The notes are places in the videos of the course and in the course scripts below the video as well. Also, we wrote the whole blog post explaining how to set it up correctly on Symfony 5, you can check it out here: https://symfonycasts.com/blog/behat-symfony - this should help to set it up on Symfony 5+, so in theory, it should also work for Symfony 6. We use Behat on the SymfonyCasts project, and we're on Symfony 6.1 now, so we upgraded without major problems and Behat still works for us.
So in short, the only problem with Behat on Symfony 5+ versions is setting it up and configuring properly to make it work. As soon as you were able to do this - it should work well and the concepts we're teaching in https://symfonycasts.com/screencast/behat are still valid for today.
But in case you get stuck following that course on the newest Symfony 6 version - let us know in the comments below the video or in that blog post and we will help you! I hope this helps :)
Cheers!
Thank you for this awesome course! I thought testing was scary, but as I follow the tutorials and finish it, I guess now the dinosaurs are scarier than writing tests
Haha, thanks for the great feedback, we are happy that you learned to not touch hungry Dino ;)
Sorry but can't share any details yet. Keep watching updates!
Thanks for your feedback, stay tuned more interesting courses are coming!
Thanks for this awesome course! Will Behat be updated soon?