Module 12: Tests and quality
Before learners share code, they learn to prove it works and to pass the checks the project applies to every change. This module runs the kernel's test suites, has learners write a test of their own, and goes through the checks and hooks that keep the main branch green.
At a glance
| Course | Developers |
| Duration | 2 hours 25 minutes (with one 10-minute break) |
| Lessons | 3 |
| Level | Intermediate |
Lessons
| Lesson | Duration | What learners do |
|---|---|---|
| Lesson 12.1: The test suites | 40 minutes | Find the suites, run the security suite and one test file |
| Lesson 12.2: Writing a test | 50 minutes | Test mysite_initials, break the code, see the test fail |
| Lesson 12.3: Checks before you share a change | 45 minutes | Hooks, manifest, commit messages, syntax and the tests of a change |
Preparing this module
- The installations need the development dependencies (
vendor/bin/phpunitexists aftercomposer install). - Lesson 12.3 needs the kernel as a Git clone with the remote
origin; learners commit only on their own branch and never push in this module. - On a shared training server, run tests with
nice -n 15and one suite at a time. make devtoolsdownloads PHP_CodeSniffer and PHPStan; run it before the class if the connection is slow.
Timing plan
| Part | Minutes |
|---|---|
| Lesson 12.1 | 40 |
| Lesson 12.2 | 50 |
| Break | 10 |
| Lesson 12.3 | 45 |
| Total | 145 |
Related pages
- Developers: course overview
- Trainers: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.