PHPackages                             atoum/atoum-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. atoum/atoum-bundle

ActiveSymfony-bundle[Testing &amp; Quality](/categories/testing)

atoum/atoum-bundle
==================

Bundle around atoum unit testing framework

3.0.0(7mo ago)44360.9k↓45.5%26[11 issues](https://github.com/atoum/AtoumBundle/issues)[4 PRs](https://github.com/atoum/AtoumBundle/pulls)10MITPHPPHP &gt;=8.1

Since Nov 14Pushed 7mo ago17 watchersCompare

[ Source](https://github.com/atoum/AtoumBundle)[ Packagist](https://packagist.org/packages/atoum/atoum-bundle)[ Docs](https://github.com/atoum/AtoumBundle)[ RSS](/packages/atoum-atoum-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (13)Versions (20)Used By (10)

AtoumBundle
===========

[](#atoumbundle)

[![Build Status](https://camo.githubusercontent.com/99b33cb48b5222530e90c097c4f5846166b82019435dc9dce522fb81a470c4f5/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f61746f756d2f41746f756d42756e646c652e706e67)](http://travis-ci.org/atoum/AtoumBundle)

This bundle provides a (very) simple integration of [atoum](https://github.com/atoum/atoum), the simple, modern and intuitive unit testing framework for PHP, into Symfony.

**Version 3.0+** requires **Symfony 7+** and **PHP 8.1+**.

Installation
------------

[](#installation)

### With composer

[](#with-composer)

```
{
    "require-dev": {
        "atoum/atoum-bundle": "^3.0"
    }
}
```

**Note:** For Symfony 6 and earlier versions, use `^2.0` instead.

Command
-------

[](#command)

AtoumBundle is provided with a Symfony command. You can launch atoum tests on specific bundles.

### Registering in the kernel

[](#registering-in-the-kernel)

Add AtoumBundle to your `config/bundles.php` (Symfony 4+):

```
return [
    // ...
    atoum\AtoumBundle\AtoumAtoumBundle::class => ['dev' => true, 'test' => true],
];
```

For older Symfony versions, add to your `AppKernel.php`:

```
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    //.....
    $bundles[] = new atoum\AtoumBundle\AtoumAtoumBundle();
}
```

### Configuration

[](#configuration)

Define your bundles in `config/packages/test/atoum.yaml`:

```
atoum:
    bundles:
        # note that the full name, including vendor, is required
        AcmeFooBundle: ~ # FooBundle is defined with directories Tests/Units, Tests/Controller
        MeBarBundle:
            directories: [Tests/Units, Tests/Functional, ...]
```

For Symfony 3 and earlier, use `config_test.yml` instead.

### Command-line usage

[](#command-line-usage)

**Modern Symfony 7+ approach (recommended):**

```
# Test any directory directly (no configuration needed!)
$ php bin/console atoum --directory=src/Tests
$ php bin/console atoum --directory=tests
$ php bin/console atoum --directory=tests/Unit --directory=tests/Integration
```

**Legacy bundle-based approach (still supported):**

```
$ php bin/console atoum FooBundle # launch tests of FooBundle
$ php bin/console atoum FooBundle BarBundle # launch tests of FooBundle and BarBundle
$ php bin/console atoum acme_foo # launch tests of bundle where alias is acme_foo
$ php bin/console atoum # launch tests from configuration
```

**🎯 See [UPGRADE-3.0.md](UPGRADE-3.0.md) for complete migration guide and examples.**

Simple Usage
------------

[](#simple-usage)

Make your test class extend the `atoum\AtoumBundle\Test\Units\Test` class of the bundle.

*Don't forget to load this class with your favorite method (require, autoload, ...) if you don't use composer.*

```
