It's Friday night... it's stormy... the office is empty... and you're deploying fresh code to production. Suddenly, an alarm! What!? The fences are down!? The dinosaurs are escaping! Somehow, your beautiful code contained a bug! As the raptors surround you, one thought keeps coming back: If only we had written tests.
In this tutorial, we're going to jump over the hurdle of learning how to test so you can save the day!
What You'll Learn
- Basic Unit Testing: Understand the fundamentals.
- Test-Driven Development: How to do it, when to do it!
- Mocking and Test Doubles: Creating mocks in PHPUnit & Prophecy.
- Data Providers: Run tests repeatedly with different input.
- Test Lifecycle Management: Execute code before and after each test.
- Exception Testing: Ensure your code handles errors properly.
- Database Handling: Manage and test database interactions.
- Integration Tests: Test with real objects.
- Functional Testing: Ensure your application works optimally end-to-end.
- Continuous Integration (CI): Let the robots run your tests for seamless deployment.