Contato
Contato
Minha conta
09.06.17

O Glpi agora usa o atoum para seus testes unitários!

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.

Você também pode gostar estes artigos

13.07.26
For two days, the digital trust ecosystem gathered to discuss the future of IT infrastructures. GLPI was proud to stand alongside its partner EORIS at the Digital Sovereignty Fair (Salon de la Souveraineté Numérique). Through live demonstrations, networking, and insightful discussions, this event highlighted a clear trend: a growing interest in alternatives capable of balancing operational performance, strict data […]
08.07.26
The GITEX AI Europe exhibition, held on June 30 and July 1 in Berlin, provided an opportunity for the GLPI teams to connect with key players in the European technology sector. Over the course of these two days, we shared our approach to digital sovereignty—an area where the Open Source model delivers concrete solutions for IT infrastructure management. Constructive exchanges […]
01.07.26
Congratulations! We are pleased to announce our new Silver GLPI Network partner in Romania: Quartz Matrix. Quartz Matrix is a Romanian technology company focused on digital transformation for three key sectors: education, industry, and public administration. With deep expertise in IT&C, the company develops and integrates solutions spanning cloud computing, IoT, artificial intelligence, cybersecurity, and […]
01.07.26
On 23 and 24 June 2026, the GLPI team attended the CoTer Numérique Congress in Reims — one of the key annual gatherings for IT decision-makers in French local government. A stand at the centre of the conversation Set up at stand n°3 (Espace Parvis), the team spent two days meeting a broad cross-section of […]
30.06.26
GLPI was at VivaTech 2026, celebrating its 10th edition — the flagship global tech event in Paris — and this one delivered on every front. Set up at the We Are Normandy pavilion (Stand 2B59 – Hall 7.2), the Teclib' team spent three days building connections with institutional figures, large enterprise clients, local government representatives, […]
29.06.26
We are notifying the GLPI community of several security vulnerabilities identified in a number of community plugins. Updates are available and should be deployed promptly on all affected instances. Affected Plugins and Vulnerabilities The vulnerabilities identified cover a range of severity levels, including a critical Remote Code Execution (RCE) flaw in GenericObject (CVSS 8.9), multiple […]
25.06.26
On Friday, June 12, the whole Teclib' team came together in Caen, home to our technical crew, for the Teclib' Day: a packed day of half-year reviews, upcoming projects, and genuine team bonding. Morning: Half-Year Reviews at MoHo The day started at MoHo, a creative coworking space in the heart of Caen, over coffee and […]
24.06.26
Two new GLPI versions are available 11.0.8 and 10.0.26 releases fix several critical 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: You will find below the list of security issues fixed in theses bugfixes versions: […]
23.06.26
You can download it on the GLPI Agent github project: https://github.com/glpi-project/glpi-agent/releases/tag/1.18 This new version is essentially a security fix release for the following security issues: The release also includes few bug fixes: You can check changes details in the official online Changelog available here: https://github.com/glpi-project/glpi-agent/blob/1.18/Changes About packaging, here is what you should retain: This time, we strongly […]
17.06.26
We are pleased to announce our new Silver GLPI Network partner in Poland: OpenIT. OpenIT is a Polish IT services company dedicated to helping businesses and institutions run their technology reliably, securely and without unnecessary complexity. From helpdesk and server administration to cybersecurity, Microsoft 365, virtualization and cloud solutions, OpenIT provides end-to-end IT support tailored […]
10.06.26
Congratulations! We are pleased to announce our new Silver GLPI Network partner in Switzerland: Forfirm Consulting Sagl. Founded in 2014, Forfirm is a consulting firm specializing in ICT & Digital, Finance, and Governance, Risk & Compliance (GRC). With offices in Zurich and Lugano, the company operates at the heart of the Swiss business ecosystem, supporting […]
03.06.26
Congratulations! We are pleased to announce our new Silver GLPI Network partner in Japan: HOGO Japan . HOGO Japan provides IT support, system management, and digital operations services to businesses operating in Japan — including financial institutions, industrial companies, corporate offices, and customer-facing service businesses. With a strong focus on reliability and responsiveness, they help […]
02.06.26
We are pleased to announce the availability of the beta version of the Nutanix plugin for GLPI 10 and GLPI 11. This beta release is open to the entire GLPI community. Its goal is to let users test the plugin across a variety of environments and use cases — and your feedback is what will […]
25.05.26
We are pleased to announce our new Silver GLPI Network partner in Ecuador: Bytebloom EC. Bytebloom EC is an Ecuadorian company specializing in automation, IT service management, monitoring, and observability. Based in Ecuador, they support both public and private organizations in streamlining and optimizing their technology operations. Their expertise in ITSM and IT infrastructure management […]
22.05.26
Congratulations! We are happy to announce our new Silver GLPI Network partner in Brazil: Pronet We are pleased to announce our new Silver GLPI Network partner in Peru: Comutel Perú. Comutel Perú is an infrastructure and IT solutions provider focused on the Peruvian enterprise market. The company specializes in the distribution of strategic technologies designed […]
27.05.26
Modern IT organizations depend on a growing network of external providers: cloud platforms, SaaS vendors, hardware suppliers, and managed service partners. Managing these relationships effectively has become a core discipline in IT Service Management. This article explores Supplier Management through the ITIL 4® framework, and shows how GLPI turns this practice into a concrete, integrated […]
20.05.26
In October 2025, we released a new tool to help you understand the environmental impact of operating digital services — computers, servers, monitors, mobile devices, and network devices. The plugin Carbon, available to everyone via the GLPI Marketplace and our project's GitHub, will outline the carbon footprint of your company's digital assets. Everybody has an […]
18.05.26
Por anos, uma comunidade global de integradores tem sido a espinha dorsal do sucesso do GLPI. Muitos trabalham de forma independente, prestando serviços de alta qualidade aos seus clientes. Mas à medida que o ecossistema cresce, também cresce a necessidade de reconhecimento profissional e suporte direto do editor. Qual é o status de registrado? O status Registrado é o ponto de entrada oficial na Teclib' […]
13.05.26
Temos o prazer de anunciar que o Plugin Carbon para GLPI 1.2.0 está agora disponível. Desenvolvido como parte do Projeto IEN (Impacto Ambiental do Numérico) em colaboração com a IRT SystemX, Teclib' e outros parceiros, este plugin ajuda as equipes de TI a avaliar a pegada ambiental de seus ativos diretamente do GLPI. O que há de novo Esta versão traz [significativas]
06.05.26
Seu CEO pergunta por que os incidentes no departamento financeiro estão demorando duas vezes mais para serem fechados. Você sabe a resposta. Você viveu nesses tickets por semanas. Mas saber não é o mesmo que mostrar, e sem um dashboard adequado, o trabalho permanece invisível. Essa é a lacuna que o plugin Advanced GLPI Dashboards […].
1 2 3 ... 19
chevron-right
LinkedIn Facebook Pinterest youtube rss Twitter Instagram facebook-em branco rss-em branco linkedin-em branco Pinterest youtube Twitter Instagram