- Online 2021
Do you spend too much time debugging your code? Does manually re-testing everything seem unreliable and cause pre-release stress? With unit tests, you can significantly reduce these unpleasant tasks while increasing your confidence in the correctness of your software.
In this course, you will learn the fundamentals of unit tests and PHPUnit. You will then discover how to improve and simplify your tests using mocks. Finally, you will learn how to write integration tests for parts of your application that interact with the database and files. By the end of this course, you will be able to write good tests and increase the quality of your software.
- PHPUnit fundamentals: structuring tests, executing via command-line, assertions and annotations, bootstrap and configuration files.
- Better tests: making tests faster, making tests easier to write and to maintain, spotting redundant or unreliable tests.
- Using mocks: code and test isolation, types of mocks and how to use them, what not to mock, avoiding too many mocks.
- Integration tests: testing code that depends on the database, filesystem or library with a complex API.
- Code coverage: collecting code coverage and interpreting reports.
- Continous integration: setting up a pipeline, ensuring that existing tests don't break.