Just like SimpleTest or PHPUnit, Atoum is a unit testing framework specific to the PHP programming language. However, it has been designed from the start with the following ideas in mind:

  • Rapid implementation,
  • Simplify test development,
  • Make unit test more reliable, readable, and clear.


Atoum massively uses capabilities provided by PHP, to give the developer a whole new way of writing unit tests. Therefore, it can be installed and integrated into an existing project extremely easily, since it is only a single PHAR archive, which is the one and only entry point for the developer.

The framework natively, and by default, performs the execution of each unit test within a separate PHP process, to warrant isolation. Of course, it can be used seamlessly for continuous integration, and given its design, it can be made to cope with specific needs extremely easily.

It also accomplishes all of this without affecting performance, since it has been developed to boast a reduced memory footprint while allowing for hastened test execution. It can also generate unit test execution reports in the Xunit format, which makes it compatible with continuous integration tools such as Jenkins.

With Atoum, the asserters will make you tests easy to read and simplify your test. Also, more things will be tested with less code because asserter will also test things like types.

<?php
$this
  ->string("hello world")
      ->endWith("world")
      ->hasLength(11)
  ->array([1, 2, 3])
      ->hasSize(3)
;

Also you can easily create mocks with a lots of feature and less headache. Atoum mocks will make you not hesitate to write mocks, so your tests will be more decoupled and easier to maintain.

<?php
$mockDbClient = new \mock\Database\Client();

// Redefine the method connect
// it will always return true
$this->calling($mockDbClient)->connect = true;

// Redefine the method select
// it will execute the given anonymous function
$this->calling($mockDbClient)->select = function() {
  return array();
};

Atoum also generates code coverage reports, in order to make it possible to supervise unit tests. Finally, even though it is developed mainly on UNIX, it can also work on Windows.

More information at http://atoum.org/

LEAVE A REPLY

Please enter your comment!
Please enter your name here