Contact
09.06.17

GLPI utilise désormais atoum pour ses tests unitaires

About 2 years ago, we’ve begin to add some unit tests in the GLPI project; thanks to Valentin and Remi Collet. The PHPUnit framework has been used, since this is the most "common" choice for a PHP project.

Unfortunately, many parts of the code are not tested yet... This is a huge job; but we’re working on it. Nowadays, each new feature implemented in GLPI is unit tested; and we plan to spend time this summer to work on all of this.Why now?I personally appreciate atoum since its very beginning, and I’ve proposed to switch a while ago. Since we plan to add more and more tests; switching while there are still a few tests was easier. That’s why it’s been done now.So, why to switch?Well... Speaking of PHP unit testing frameworks, there are not so many possible choices. PHPunit is probably the oldest unit testing framework available for PHP; and it does the job, really. atoum is a more recent and modern choice, and it has some interesting capabilities:

  • testing variables types (if you test an integer and get a string, this is not correct),
  • wonderful mocking system (that permit to mock php native functions, constants, ...),
  • use closure to test outputs, exceptions, ... (way more interesting than phpunit’s annotations),
  • concurrent run of tests (even if it have been disabled for GLPI),
  • fully isolated tests,
  • chained calls,
  • more natural way to write tests (this is maybe just my point of view - but this is really more simple to me).

Also, GLPI is a French project, most core team members are French, just as atoum! 😉On a technical noteSwitching from PHPUnit to atoum is not something very difficult, especially if you did not yet use advanced features (which is the case for GLPI); but it is not really something that can be scripted. In facts, it could for some common cases, but reviewing tests is not something bad globally. Also, re-writing tests is a very good start point to learn new syntax, asserters and possibilities.For the GLPI project, we’ve spent two days working on the rewrite. What we had to take care of:

  • atoum is not permissive at all. Every notice in the code will make tests fail per default (which is a good point); we had to fix them;
  • we’re doing kind of functional tests and not only unit tests. Some existing tests used to change existing values in the database, before resetting them. That cannot be done running tests concurrently;
  • atoum does not support dependencies across tests; which phpunit does. It should seem a bad point, but the point is "tests are isolated". So... They cannot be dependent, we had to find another way;
  • session usage: GLPI uses many data in the session; and that is really a problem for testing... We had to disable concurrent runs mainly because of that :’(

The futureIn a close future, we plan to improve our unit tests; since many parts of the code are not tested at all. We also plan to split our unique directory into several ones, making possible to disable concurrent runs only on functional tests, not on the whole tests suite.Johan Cwiklinski.

Vous aimerez peut-être aussi ces articles

12.11.26
Two new bugfix versions of GLPI are out: 12.0.2 and 11.0.13. They fix several recently discovered security issues, so we strongly recommend updating. Security fixes The following vulnerabilities are fixed in both versions: Bug fixes These releases also include many bug fixes. See the changelogs for details: Download Both archives are available on GitHub: Thank […]
12.11.26
Sent a followup too quickly? CancelSend lets you temporarily cancel the sending of a followup, a task or a solution in GLPI 11 and GLPI 12. Features The plugin offers: A handy feature to correct a mistake before the content is sent. Download and documentation Download: available on the GLPI MarketplaceIncluded starting from the Basic […]
12.11.26
We are proud to announce this new release of the Carbon plugin for GLPI, which brings bugfixes and adds support of cloud servers with the help of the plugin Cloud Inventory. Built as part of the IEN Project (Impact Environnemental du Numérique) with IRT SystemX, Teclib’ and other partners, this plugin helps you to evaluate […]
11.11.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in Mauritania: B.I.TECH. Based in Nouakchott, B.I.TECH (Bureautique, Informatique & Technologies) works with companies and organizations on the design, deployment and maintenance of their IT infrastructure. Its core areas of expertise are IT equipment, networks and information systems security. The company relies on […]
09.11.26
La quatrième édition des Journées des partenaires GLPI s'est déroulée à Marrakech les 15 et 16 octobre 2026. Deux journées consacrées à la présentation de la stratégie de Teclib, à la découverte de GLPI 12.0 et, surtout, à l'écoute des partenaires qui déploient GLPI sur le terrain au quotidien. Merci à tous ceux qui ont participé à ces échanges enrichissants. Voici les principales annonces et […]
05.11.26
MoreOptions succède officiellement au plugin Behavior. Il en reprend les principales fonctionnalités pour automatiser la gestion des objets ITIL dans GLPI 11. Ce que MoreOptions apporte à GLPI 11 Avec MoreOptions, vous pouvez : GLPI 12 : une nouvelle implémentation du plugin Escalade Dans GLPI 12, MoreOptions intègre une réécriture complète du plugin Escalade, avec : les tickets, […]
04.11.26
« Teclib’ » a entamé les démarches en vue de la certification ISO/IEC 27001:2022. L’entreprise bénéficie du soutien du cabinet de conseil Akant, dans le cadre du dispositif « Impulsion Conseil » géré par AD Normandie et financé par la Région Normandie. Nos clients, nos partenaires et la communauté GLPI nous accordent leur confiance, et la sécurité de l’information constitue un élément essentiel de cette confiance. […] Traduit avec DeepL.com (version gratuite)
La CNAF (Caisse nationale des allocations familiales) chapeaute le réseau français des allocations familiales : 101 caisses locales, les CAF, à raison d’une par département, chacune versant des allocations familiales aux personnes résidant sur son territoire. GLPI fait partie de ce réseau depuis 2009. Aujourd’hui, elle traite environ 800 000 demandes par an pour 35 000 utilisateurs. Marc Dufant, anciennement chez […]
03.11.26
L'ITIL est souvent mentionné dans la plupart des offres d'emploi dans le domaine informatique, des appels d'offres et des présentations d'outils d'assistance. Mais qu'est-ce que l'ITIL, exactement ? Ce terme désigne un ensemble de bonnes pratiques en matière de gestion des services informatiques (ITSM), utilisées par les services informatiques pour organiser leur assistance, leurs processus et leurs relations avec les utilisateurs et les clients des services. Ce guide aborde […]
30.10.26
Félicitations ! Nous sommes heureux d’annoncer l’arrivée d’un nouveau partenaire Silver du réseau GLPI en France : ALL4IT. ALL4IT est une société de conseil et de services informatiques spécialisée dans l’intégration depuis plus de 20 ans. Son expertise couvre également les services gérés, la cybersécurité et l’optimisation des infrastructures informatiques. Basée en France et présente à l’international, l’entreprise aide les organisations à gérer […]
29.10.26
From October 7 to 9, 2026, Teclib' travelled to Riga, Latvia, home of Zabbix's global headquarters, to take part in the Zabbix Summit. Our CEO, our Channel Manager, our Partner Success Manager and our Technical Writer were there with a clear goal: to get to know the Zabbix ecosystem from the inside, understand how its […]
28.10.26
12.0.1 and 11.0.12 releases fix several security issues that have been recently discovered. Update is stronglyrecommended! Many bug fixes have also been made, read the changelogs for more details: You can download the new archives on GitHub: https://github.com/glpi-project/glpi/releases You will find below the list of security issues fixed in theses bugfixes versions: We would like to thank all […]
27.10.26
Félicitations ! Nous sommes heureux d’annoncer l’arrivée d’un nouveau partenaire Silver du réseau GLPI en France : AXEL IT Solutions. Basée à Paris La Défense, AXEL IT Solutions est spécialisée dans les outils de gestion des processus ITIL. L’entreprise aide les organisations à transformer les pratiques ITIL en une plateforme ITSM opérationnelle. Son équipe accompagne ses clients à chaque étape : déploiement, intégration et évolutions fonctionnelles de […]
21.10.26
On October 21, 2026, at 14:00 UTC, the PHP development team released critical security updates addressing two major vulnerabilities, tracked as CVE-2026-109618 and CVE-2026-109619 (commonly referred to as "php2shell"). Full technical details regarding these flaws, their potential security impact, and recommended workarounds can be found in the official PHP.net announcement. Here is a breakdown of what this security advisory means for your ITSM infrastructure and how […]
19.10.26
Nous sommes heureux d'annoncer la sortie officielle du plugin GLPI AI 2.0. Cette nouvelle version est une réécriture complète du plugin d'intelligence artificielle de GLPI. Basée sur le bundle Symfony AI, elle a été conçue pour offrir une assistance fluide, autonome et personnalisable, au cœur du travail quotidien des équipes de support.
ARSEAA est une association française à but non lucratif de 1 800 employés, active dans les secteurs médico-social, de la santé, social et de la formation. Elle gère désormais le support informatique et la maintenance des bâtiments sur une instance GLPI unique, hébergée sur GLPI Network Cloud Private en France. L’outil a d’abord été déployé pour résoudre des problèmes de maintenance sur un site. Voici comment […]
12.10.26
Félicitations ! Nous sommes heureux d’annoncer notre nouveau partenaire Silver du réseau GLPI au Royaume-Uni : Infotel UK. Infotel est bien connu de la communauté GLPI. L’entreprise collabore avec GLPI depuis 2006 et est déjà partenaire Platine du réseau. Grâce à ce nouveau partenariat Silver, Infotel UK met directement son expérience à profit […]
08.10.26
GLPI-Agent 1.21 est disponible. Vous pouvez le télécharger sur le projet GitHub de GLPI Agent : https://github.com/glpi-project/glpi-agent/releases/tag/1.21. Correction d'une régression : Cette version est publiée plus tôt que prévu afin de corriger une régression introduite dans la version 1.20. Améliorations : Cette version inclut également quelques améliorations. Vous pouvez consulter le détail des modifications dans le journal des modifications officiel en ligne, disponible ici : https://github.com/glpi-project/glpi-agent/blob/1.21/Changes. Concernant le packaging, […]
07.10.26
GLPI 12 est la dernière version majeure de la solution ITSM open source. Elle introduit une base de connaissances entièrement repensée, offre aux administrateurs un meilleur contrôle des sessions utilisateur actives et garantit que les échéances internes sont automatiquement appliquées à l'équipe responsable. Cette version renforce également la sécurité de la plateforme, sans configuration supplémentaire. Dans cet article, nous […]
06.10.26
Qu’est-ce que le protocole SCIM (System for Cross-domain Identity Management) ? L’automatisation de la gestion des identités est devenue une priorité absolue pour toute entreprise qui ajoute régulièrement des applications métier. Cet article présente les points essentiels du protocole SCIM : sa définition, son fonctionnement technique, les avantages concrets qu’il apporte aux équipes informatiques et sa comparaison avec d’autres protocoles.
1 2 3 … 21
chevron-droit
LinkedIn Facebook Pinterest YouTube rss Twitter instagram facebook-vide rss-vide linkedin-vide Pinterest YouTube Twitter instagram