The idea
Does your code really work?
You write PHP code, but you do not test it automatically yet? Or you already use AI agents that generate code. But how do you make sure that this code really works?
Automated tests are the answer. In a world in which more and more code is written faster and faster, tests matter more than ever:
Safety net
Tests catch defects before they reach production, and give you the confidence to change code.
Specification
Tests document in executable form what your code is supposed to do. For you, your team, and your tools.
Quality guarantee
Tests automatically verify on every change that everything works. Also for code that you did not write yourself.
PHPUnit is the standard tool for automated tests in PHP. In this training you learn it from the ground up: you find out how to set up PHPUnit, write your first tests, and step by step make even complex code testable. After this training you have the tool and the knowledge to use automated tests in your own project.
From the contents
From the first assertion to a safety net
Four sessions of two hours each, live and interactive. You write your own tests in practical exercises instead of just watching. The path leads from the fundamentals to tests that are still maintainable tomorrow.
-
01
Why automated tests, and why now?
Tests as a safety net, specification, and quality guarantee in the age of AI-generated code.
-
02
Setting up PHPUnit
Installation, configuration, and integration into your development workflow.
-
03
Writing automated tests
From the first assertion to a comprehensive test case.
-
04
Testing complex code
Getting objects with state and side effects under control.
-
05
Testing independently of dependencies
The fundamentals of test isolation.
-
06
Best practices
Tests that not only work, but are also readable and maintainable.
Who it is for
Your entry into automated testing
This training is aimed at PHP developers who want to make automated testing part of their daily work. Whether you have never written a test or want to take your first steps with PHPUnit: here you get the start you need.
What you take away
- You set up PHPUnit and integrate it into your development workflow
- You write tests for your code on your own, practised in exercises during the training
- You understand how to make even complex code with dependencies testable
- You know the proven practices that keep your tests understandable and maintainable
What you bring
- Several months of experience with PHP or a similar programming language
- Familiarity with the basic concepts of procedural and object-oriented programming
- A local PHP development environment for the practical exercises
- Prior knowledge of testing is not required: we start at the very beginning
The training helped me a lot to get started with unit tests and to better understand the reasoning behind them. I now know exactly how I should approach unit tests and also how to name and develop them. I also found the background on how PHPUnit came about very interesting. For anyone who wants to start with unit tests, this training is very good.
Your trainer
Sebastian Bergmann
Sebastian is the creator of PHPUnit, the de facto standard for testing PHP code. As a consultant, trainer, and co-founder of thePHP.cc he has been helping teams build maintainable and well-tested software for more than two decades.
You learn PHPUnit first-hand here: from the person who wrote it. Live, with practical exercises and answers to your questions.
Registration
Four interactive live sessions of two hours each, as a Zoom meeting. Small group, practical exercises, your questions.