Download the PHP package atoum/atoum without Composer

On this page you can find all versions of the php package atoum/atoum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package atoum

atoum Package version Build Status Coverage Status Lint Gitter

PHP version atoum version
5.3 -> 5.6 1.x -> 3.x
7.2 -> 8.1 4.X -> 4.1
8.x 4.1 < 4.X (current)

A simple, modern and intuitive unit testing framework for PHP!

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

To accomplish that, it 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. Also, thanks to its fluent interface, it allows for writing unit tests in a fashion close to natural language. It also makes it easier to implement stubbing within tests, thanks to intelligent uses of anonymous functions and closures. atoum 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. atoum 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. 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.

Why atoum?

Prerequisites to use atoum

atoum absolutely requires PHP >= 5.6.0 or later to work. On UNIX, in order to check whether you have the right PHP version, you just need to run the following command in your terminal:

If PHP 5.6.x or equivalent gets displayed, then you have the right PHP version installed. Should you want to use atoum using its PHAR archive, you also need PHP to be able to access the phar module, which is normally available by default. On UNIX, in order to check whether you have this module or not, you just need to run the following command in your terminal:

If Phar or equivalent gets displayed, then the module is properly installed. Generating reports in the Xunit format requires the xml module. On UNIX, in order to check whether you have this module or not, you just need to run the following command in your terminal:

If Xml or equivalent gets displayed, then the module is properly installed. Should you wish to monitor the coverage rate of your code by the unit tests, the Xdebug 2.3 module will be required. On UNIX, in order to check whether you have this module or not, you just need to run the following command in your terminal:

If Xdebug or equivalent gets displayed, then the module is properly installed.

A unit testing framework that can be made operational in 5 minutes!

Step 1: Install atoum

You just have to download its PHAR archive and store it where you wish, for example under /path/to/project/tests/atoum.phar. This PHAR archive contains the latest development version to pass the totality of atoum's unit tests. atoum's source code is also available via the GitHub repository. To check if atoum works correctly with your configuration, you can execute all its unit tests. To do that, you just need to run the following command in your terminal:

Step 2: Write your tests

Using your preferred text editor, create the file path/to/project/tests/units/helloWorld.php and add the following code:

Step 3: Run your test with the command line

Launch your terminal and run the following command:

You should get the following result or something equivalent:

Step 4: Write the class corresponding to your test

Using again your preferred text editor, create the file path/to/project/classes/helloWorld.php and add the following code:

Step 5: Run your test once more

In the same terminal, run the following command once again:

You should get the following result, or something equivalent:

Step 6: Complete your tests and restart the cycle from Step 3

To go further

atoum's documentation is still being written. Any help to improve it will be appreciated. However, if you want to further explore immediately atoum's possibilities, we recommend:

Troubleshooting

atoum's PHAR archive seems to not be working

In this case, the first thing you will want to do is confirm whether you have the latest version of the archive. You just need to download it again. If it still doesn't work, run the following command in a terminal window:

If you get atoum's version number, then the problem is coming from your PHP configuration. In most cases, the cause would be within extensions, that might be incompatible with the PHAR format, or that would prevent executing PHAR archives as a security measure. The ioncube extension for instance seems incompatible with PHAR archives, and you must, therefore, deactivate it if you are using it, by commenting the following line out of your php.ini, by prefixing it with the ; character:

The suhosin extension prevents executing PHAR archives, therefore its default configuration must be modified in order to be able to use atoum, by adding the following line in your php.ini file:

Finally, if running atoum causes the screen to display characters looking like ???%, this would be because the detect_unicode directive inside your php.ini file is set to 1. To fix the problem, you just need to set it to 0 by editing your php.ini file or by running atoum with the following command:

If these three operations do not allow atoum to work, we suggest you send an e-mail to the address support[AT]atoum(DOT)org, describing in detail your configuration and your problem. You can also ask for help from the atoum development staff on the discussion channel of the atoum repository..

Error: Constant __COMPILER_HALT_OFFSET__ already defined /path/to/atoum.phar

This error comes from the fact the atoum PHAR archive is included in more than one place within your code using include or require. To fix this problem, you just need to include the archive by using only include_once or require_once, in order to ensure it is not included several times.

APC seems not work with atoum

APC is a free, open, and robust framework for caching and optimizing PHP intermediate code distributed under the form of a PHP extension. When testing classes that use APC, you may get some failure message showing that apc_fetch function is unable to retrieve a value. As all PHP extension, APC has some configuration options to enable it:

In order to use APC with atoum, you have to set apc.enabled and apc.enable_cli to 1, otherwise, it won't be enabled for the PHP CLI version, which is used by atoum.

Getting segfault when mocking objects

When using atoum and mocking objects, you will sometime get segfaults coming from PHP. These segfaults are caused by XDebug in version less than 2.1.0 which has problem handling reflection in some cases. To check the current version of XDebug, you can run php -v. To fix this issue, you have to update XDebug to the latest stable version. If you can't update XDebug on your system, you can still disable the extension to avoid getting segfaults. To be sure that XDebug has been successfully updated or disabled, you can run php -v. When you are done updating or disabling XDebug, run php atoum.phar --test-it to be sure that all the segfaults have gone and that atoum is working.


Roadmap

Looking for a roadmap?

Credits

atoum has been created by Frédéric Hardy. It is now led by a strong community of contributors. You can find them in the committer list or in the Contributors team.

License

atoum is released under the BSD-3-Clause License. See the bundled LICENSE file for details.


All versions of atoum with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-hash Version *
ext-json Version *
ext-tokenizer Version *
ext-xml Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package atoum/atoum contains the following files

Loading the files please wait ....