https://github.com/atoum/autoloop-extension
Automaticly run atoum's loop mode on file change
https://github.com/atoum/autoloop-extension
atoum atoum-extension php test
Last synced: 20 days ago
JSON representation
Automaticly run atoum's loop mode on file change
- Host: GitHub
- URL: https://github.com/atoum/autoloop-extension
- Owner: atoum
- License: mit
- Created: 2016-01-13T19:42:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-02-03T09:37:04.000Z (3 months ago)
- Last Synced: 2025-03-24T16:46:16.941Z (about 1 month ago)
- Topics: atoum, atoum-extension, php, test
- Language: PHP
- Homepage:
- Size: 1.64 MB
- Stars: 3
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# atoum/autoloop-extension [](https://github.com/atoum/autoloop-extension/actions)
autoloop-extension allows you automatically run your tests in atoum's loop mode when files are changed.
## Example
Here is an example: we can see that the test files are automatically executed when the classes and test classes are changed.

## Install it
Install extension using [composer](https://getcomposer.org):
```
composer require --dev atoum/autoloop-extension
```Then, the only thing you have to do is to set the watched files like this:
```php
getExtension(atoum\atoum\autoloop\extension::class)
->setWatchedFiles(array(__DIR__ . '/src'))
;
```## Use it
When the extension is loaded a new option is available:
```
--autoloop: Automatically relaunch tests on file change (implies --loop)
```So, instead of launch the loop mode like this (an having to press enter each time you want to run the tests):
```
./vendor/bin/atoum --loop
```Just run the tests like this:
```
./vendor/bin/atoum --autoloop
```All your usual options are available.
## Tips
### Notifications
This extension works well with with atoum's notification.
```php
//.atoum.php$report = $script->addDefaultReport();
$notifier = new atoum\report\fields\runner\result\notifier\image\libnotify();
$notifier
->setSuccessImage(__DIR__ . '/vendor/atoum/atoum/resources/images/logo/success.png')
->setFailureImage(__DIR__ . '/vendor/atoum/atoum/resources/images/logo/failure.png')
;$report
->addField($notifier)
;
```With a setup like this, you will not even have to look at your console to see your test results. Here is what it looks like:

## Links
* [atoum](http://atoum.org)
* [atoum's documentation](http://docs.atoum.org)## Licence
autoloop-extension is released under the MIT License. See the bundled LICENSE file for details.
