Publication date : 03/05/2024

Course : PHPUnit, mastering unit tests

Practical course - 2d - 14h00 - Ref. TUH
Price : 1470 € E.T.

PHPUnit, mastering unit tests




In order to control the quality of your developments, you will learn how to implement unit tests with PHPUnit. You'll learn in detail about PHPUnit's mechanisms and how to use this tool in the development of new features, as well as in the maintenance of legacy code or code coverage.


INTER
IN-HOUSE
CUSTOM

Practical course in person or remote class
Disponible en anglais, à la demande

Ref. TUH
  2d - 14h00
1470 € E.T.




In order to control the quality of your developments, you will learn how to implement unit tests with PHPUnit. You'll learn in detail about PHPUnit's mechanisms and how to use this tool in the development of new features, as well as in the maintenance of legacy code or code coverage.


Teaching objectives
At the end of the training, the participant will be able to:
Understand the benefits of unit testing as part of a quality approach
Install, configure and use PHPUnit
Discover different approaches to test writing
Analyze your code and produce metrics

Intended audience
PHP developers, software architects.

Prerequisites
Good knowledge of object-oriented programming (OOP) and PHP.

Practical details
Hands-on work
Learn how to use the tool, get a new development off to a good start or make an existing application more reliable.
Teaching methods
Alternating lectures (50%) and practical exercises (50%).

Course schedule

1
Principles of unit testing

  • What is a test?
  • Why test an application?
  • Defining unit tests.
  • What are the other types of test? How can they be classified and differentiated?
  • Fundamentals to know.
  • Composer", PHP's dependency manager.
  • PSR: an overview of certain PHP standards.
  • Initialize a PHP project in compliance with these standards using "Composer" and other tools.

2
Getting started with Framwork PHPunit

  • Presentation and history of the framework.
  • Writing PHPUnit tests with assertions, annotations, data providers, fixtures...
  • The PHPUnit command line and XML configuration.
Hands-on work
Getting to grips with the framework and setting up the first unit tests.

3
When and how to test an application

  • Test execution methods (command line, IDE, continuous integration, etc.).
  • Test-driven development /behavior-driven development.
  • Application maintenance (refactoring and bug fixing) through testing.
  • Definition and application of additional concepts (SUT, Fakes, Mocks, Stubs, etc.).
Exercise
Carry out unit tests in different variants on exercises reflecting real-life use cases.

4
Overview of code coverage

  • Basic concepts of code coverage.
  • How do you produce metrics?
  • Analyze and use metrics to improve application reliability.
Hands-on work
Installation of a code coverage tool, generation and use of metrics.

5
Testing at the heart of quality

  • The close relationship between testing and development principles (SOLID, DRY, KISS, etc.).
  • Good and bad practice in unit testing.
  • Go further with PHPUnit
  • Other PHPUnit features.
  • Other unit testing tools.
  • Write and run functional tests.


Customer reviews
3,9 / 5
Customer reviews are based on end-of-course evaluations. The score is calculated from all evaluations within the past year. Only reviews with a textual comment are displayed.
IGOR G.
11/12/25
5 / 5

Bonne pédagogie de Fabien. Beaucoup d’informations importantes distillées au cours de la formation pour agrémenter le support de cours et qui permettent de réfléchir sur l’importance des tests pour clarifier le code et permettre d’améliorer la compréhension du code pour des personnes arrivant sur un projet.
AMANDINE L.
18/09/25
4 / 5

The training was very good.



Dates and locations
Select your location or opt for the remote class then choose your date.
Remote class

Dernières places
Date garantie en présentiel ou à distance
Session garantie

REMOTE CLASS
2026 : 8 June, 10 Dec.

PARIS LA DÉFENSE
2026 : 8 June, 10 Dec.