Drupal Unit Testing / TDD course with PHPUnit
We will give a review of the different tests that can be integrated into PHP using the PHPUnit Framework. Discovering what needs to be covered at the lower levels of development and how to execute them.
Course duration
The course has a duration of 5 hours of training. This course can be complemented with practical cases in workshop mode in subsequent days on projects indicated by the applicant.
Requirements
- Knowledge of PHP (medium)
- Knowledge of Object Orientation (medium)
- Terminal handling (basic)
- Have PHP / Composer installed
- Have an IDE installed (PHPStorm, Netbeans, Visual Studio Code)
Course content
- Introduction
- Local work environment setup
- Composer
- IDE Configuration
- Fundamentals
- Introduction to assertions
- Using multiple Assertions
- Correcting Bugs through Testing
- Naming Conventions and Standards
- PHPUnit XML configuration
- Test dependencies, Fixtures and Exceptions
- Dependencies between tests
- SetUp and TearDown
- Text Fixture
- Exceptions Test
- Mocks and Stubs
- Creating mock objects to avoid external dependencies
- Dependency Injection
- Mockery - Framework
- TDD - Test Driven development
- Writing test before code
- Targeted development test
- Code refactor with tests
- Advanced test
- Protected / private methods
- Attributes & nbsp; protected / private
- Static methods
- Conclusions