Contact
Contact
My account
09.06.17

Glpi now uses atoum for its unit tests!

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.

You may also like these articles

10.03.26
For most users, WhatsApp is already the natural way to reach support. What changes now is that this conversation finally works in favor of your governance, instead of becoming another unmanaged channel. The new official integration between GLPI and WhatsApp was designed for IT analysts and support coordinators who want to centralize communication, reduce noise, and keep full […]
05.03.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in France: Armada Armada is an integrator specialized in the deployment of IT and cyber solutions, addressing the security, autonomy, and compliance challenges of IT infrastructures. Recognized by clients with high standards for digital sovereignty, security, and regulatory compliance, Armada stands out through its […]
04.03.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in Spain: Vires25 Vires25 was founded with the goal of advising and supporting clients in their journey to find the platforms that best meet their needs. The company brings together professionals with extensive experience in various IT solutions, as well as in client consultancy […]
03.03.26
Two new GLPI versions are available. These updates fix a recently discovered critical security vulnerability. Updating is highly recommended! You can download the GLPI 11.0.6 archive on GitHub. You will find below the list of security issues fixed in this bugfixes version: Also, here is a short list of important bug fixes included in this version: The full […]
02.03.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in Brazil: Marcati Marcati Soluções Tecnológicas is a company specializing in IT outsourcing and the development of strategic solutions for corporate environments. Operating with a strong foundation in open-source technologies, Marcati actively collaborates with the community to develop projects, systems, and ideas that make technology more accessible, […]
10.02.26
We are delighted to announce that Data Expertise of the Human's Connexion Group, a long-standing GLPI partner in France, has moved to Gold level, after several years as a Silver partner. Reminder: Who is Data Expertise? Data Expertise is an open-source integrator specializing in the design and architecture of IT infrastructures. The company offers hybrid […]
09.02.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in Brazil: GovTech 360 GovTech360 is a Governance and Digital Transformation company with solid experience in the implementation and operation of technological solutions for both the public and private sectors. With a track record spanning over 10 years in the technology market, the company […]
06.02.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in the Caribbean Islands: Cloud Carib Cloud Carib is a leading provider of sovereign cloud and cybersecurity services across the Caribbean and Latin America. Headquartered in The Bahamas, the company delivers secure hybrid infrastructure and managed services through locally operated data centres in […]
03.02.26
GLPI Agent 1.16 has been released. You can download it on the GLPI Agent github project: https://github.com/glpi-project/glpi-agent/releases/tag/1.16 New feature : IEC61850 standard support This new version introduces the inventory of Intelligent Electronic Devices (IED) in GLPI Agent. In practice, we integrated the libiec61850 library support which provides related protocols support and more specifically the ones permitting […]
29.01.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in United Arab Emirates: KGT Computer Software Trading K Global Technologies (KGT) operates as an independent solutions provider specializing in Supply Chain and Sustainability, delivering tailored solutions aligned to each client’s unique requirements. Established in 2018, KGT has steadily expanded its footprint across the […]
28.01.26
Two new GLPI versions are available. Today, we ship 11.0.5 and 10.0.23. These releases contain security fixes, and we encourage you to update Many bug fixes have also been made, read the changelogs for more details: You can download the new archives on GitHub: You will find below the list of security issues fixed in […]
19.01.26
Asset Management has always been the historical core of GLPI. Today, our solution goes further by connecting technical inventory with environmental challenges. Thanks to the new GLPI Carbon plugin, you can transform your CMDB into a powerful tool for steering your ecological transition. Full visibility over your IT infrastructure To optimize, you must first measure. GLPI centralizes all your data […]
14.01.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in France: Novahé Leveraging its expertise in information system integration, Novahe relies on GLPI, the leading ITSM solution, to provide its customers with unified, high-performance IT management tailored to their environments. Thanks to their mastery of complex infrastructures and their customized approach, they turn […]
13.01.26
We are delighted to announce that Synairgis, a long-standing GLPI partner in Canada (Quebec) and France, is moving to Gold level, after several years as a Silver partner. Reminder: Who is Synairgis? Synairgis, based in Quebec and France with offices in Montreal, Montpellier, and Toulouse, provides eco-responsible transformation solutions. They implement GLPI to optimize IT […]
12.01.26
The security of ITSM tools is critical, and GLPI is no exception. To protect your data and ensure the reliability of your IT environment, it is essential to keep your GLPI instance up to date. It is in this context that Orange Cyberdefense launched GLPwnMe, a project dedicated to auditing and improving GLPI’s security. What is […]
08.01.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in Brazil: Teledata Teledata is an ICT solutions integrator operating since 1987, specializing in telecommunications, IT, cybersecurity, and customer experience, driving innovation, efficiency, and business transformation. 🌐 Website: https://www.teledatabrasil.com.br/ We are excited to see GLPI ITSM expanding internationally and helping more clients through our GLPI Network offering, whether […]
29.12.25
Congratulations! We are happy to announce our new Silver GLPI Network partner in Indonesia: PT. Azentra Solusi Digital Azentra Solusi Digital  is a leading IT solutions provider in Indonesia, committed to delivering comprehensive technology solutions and services, particularly for the Banking and Financial Services industry. Supported by highly skilled professionals with extensive industry experience, we ensure […]
24.12.25
At Teclib’, the official publisher of GLPI, the end of the year is also a chance to come together differently. Before closing out the year, we organized our Teclib’ Day, a day dedicated to conviviality, sharing, and collective reflection, to celebrate our achievements and further strengthen team bonds. 🎄✨ A solidarity culinary teambuilding at Chefsquare […]
23.12.25
Open Source Experience 2025 brought together key players in open source, free software, and IT service management (ITSM). For GLPI, this edition was an opportunity to strengthen its visibility, present the new features of GLPI 11, and highlight its partner ecosystem. Over two days, the GLPI teams engaged with IT professionals, decision-makers, and partners around […]
16.12.25
Congratulations! We are happy to announce our new Silver GLPI Network partner in Brazil: Assistec Informática  A consulting and IT support company with over 30 years of experience, they operate throughout the country. Their services include IT support, technical assistance, IT outsourcing, information systems security, data centers, and cloud computing solutions. They partner with leading global […]
1 2 3 18
chevron-right
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram