Download the PHP package atoum/ruler-extension without Composer
On this page you can find all versions of the php package atoum/ruler-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download atoum/ruler-extension
More information about atoum/ruler-extension
Files in atoum/ruler-extension
Package ruler-extension
Short Description The atoum ruler-extension allows you to filter your tests using Hoa\Ruler
License MIT
Informations about the package ruler-extension
atoum/ruler-extension
This extension allows you to precisely filter test cases to run with a "natural language".
The extension adds a --filter
option to atoum. This line now appears on the atoum help:
You can now filter your tests using any Hoa\Ruler filter.
Example
This will only launch test that are not tagged with "featureA" and have the foo\bar
namespace.
Available filters
Those variables are available in the filter:
method
class
namespace
testedclass
testedclassnamespace
tags
(as an array)extensions
(as an array)
Install it
Install extension using composer:
The extension will be automatically loaded. If you ever want to unload it, you can add this to your configuration file:
Examples
Filter on tags
Run all tests who have the needsDatabase
tag:
Run all tests except those who have the needsDatabase
tag:
You can also use the ruler's default in
operator, but in that case that's less readable:
Read more about tags in atoum's documentation.
Filter on the test method name
Run all tests with a method named testMethod1
:
Run all tests with a method named testMethod1
(using an array representing a list of methods to filter):
Filter on the test classname
Run the test with the mageekguy\atoum\ruler\tests\units\testClass1
classname:
Filter on the test namespace
Run all tests in the mageekguy\atoum\ruler\tests\units
namespace:
Filter on the tested class name
Run the tests that test the mageekguy\atoum\ruler\testClass1
class:
Filter on the tested class namespace
Run the tests that test the classes in the mageekguy\atoum\ruler
namespace:
Filter on the test required extensions
Run all tests that needs the blackfire extension :
You can also use the ruler's default in
operator, but in that case that's less readable:
You can read more about the test required extensions in atoum's documentation.
Apply multiple filters
You can also define more complex filters like this: Run all tests tagged needsDatabase
and with method testClass1
or with a method testClass
:
Links
License
ruler-extension is released under the MIT License. See the bundled LICENSE file for details.