LinuxCommandLibrary

atoum

Schedule commands to run later

TLDR

Initialize a configuration file

$ atoum --init
copy

Run all tests
$ atoum
copy

Run tests using the specified configuration file
$ atoum [[-c|--configuration]] [path/to/file]
copy

Run a specific test file
$ atoum [[-f|--files]] [path/to/file]
copy

Run a specific directory of tests
$ atoum [[-d|--directories]] [path/to/directory]
copy

Run all tests under a specific namespace
$ atoum [[-ns|--namespaces]] [namespace]
copy

Run all tests with a specific tag
$ atoum [[-t|--tags]] [tag]
copy

Load a custom bootstrap file before running tests
$ atoum [[-bf|--bootstrap-file]] [path/to/file]
copy

SYNOPSIS

atoum [options] []

Note:
If installed via Composer locally, the executable is typically vendor/bin/atoum. If globally installed, it might be directly atoum.

PARAMETERS

--test-file
    Specifies a single test file to execute.

--test-dir
    Specifies a directory containing test files to execute.

--bootstrap-file
    Loads a bootstrap file before running tests, useful for environment setup.

--directories
    A comma-separated list of directories to scan for tests.

--files
    A comma-separated list of specific files to scan for tests.

--namespaces
    Filters tests by specific namespaces.

--tags
    Filters tests by specific tags defined in test methods or classes.

--methods
    Filters tests by specific method names within test classes.

--loop
    Continuously runs tests, re-executing them whenever source or test files change.

--report-xml
    Generates an XML report of the test results at the specified path.

--report-html
    Generates a human-readable HTML report of the test results at the specified path.

--coverage-xml
    Generates an XML code coverage report (e.g., Cobertura format).

--coverage-html
    Generates a browsable HTML code coverage report.

--help
    Displays help information and available options for the atoum command.

--version
    Displays the current atoum framework version.

DESCRIPTION

atoum is a modern, simple, and intuitive unit testing framework designed specifically for PHP applications. It emphasizes simplicity and expressiveness, allowing developers to write clear and maintainable tests quickly. Unlike other frameworks, atoum aims to provide a very natural syntax for defining test cases, assertions, and mock objects.

It supports various features essential for robust testing, including code coverage reporting, data providers, and powerful mock object generation. Built entirely in PHP, atoum focuses on providing a frictionless testing experience, making it easier to ensure the quality and reliability of PHP codebases. Its design principles promote isolation and independent test execution, contributing to faster and more reliable test suites.

CAVEATS

atoum is a PHP application and therefore requires a PHP interpreter (typically PHP 7.x or newer) installed on the system. It is not a native or core Linux command-line utility but rather an application run from the shell. It is most commonly installed and managed via Composer, PHP's dependency manager, either on a per-project basis or globally. Its primary use case is unit testing for PHP software development, and it is not generally applicable to non-PHP projects.

EXTENSIBILITY

atoum is designed with extensibility in mind, allowing developers to easily create custom extensions, assertions, and reports to tailor the testing experience to their specific needs. This modular architecture promotes flexibility and integration with other tools and workflows.

TEST ISOLATION

A key philosophy of atoum is test isolation. It ensures that each test runs in its own scope, preventing side effects from one test affecting another. This significantly contributes to the reliability, determinism, and maintainability of test suites, making debugging easier and ensuring consistent results.

HISTORY

atoum was created by Frédéric Bouchery and first released in 2010. It emerged as an alternative to existing PHP testing frameworks, aiming for greater simplicity, flexibility, and a more natural, human-readable syntax for writing tests. Its development has focused on providing a user-friendly and highly performant testing environment, gaining popularity within the PHP community for its approach to test isolation and expressive assertion capabilities. It continues to be actively maintained and developed by a dedicated community.

SEE ALSO

PHPUnit (PHP testing framework), Codeception (PHP testing framework), Behat (PHP BDD framework)

Copied to clipboard