2017 © Pedro Peláez
 

library ruler-extension

The atoum ruler-extension allows you to filter your tests using Hoa\Ruler

image

atoum/ruler-extension

The atoum ruler-extension allows you to filter your tests using Hoa\Ruler

  • Friday, February 24, 2017
  • by agallou
  • Repository
  • 7 Watchers
  • 10 Stars
  • 21,684 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 5 Forks
  • 2 Open issues
  • 9 Versions
  • 4 % Grown

The README.md

atoum/ruler-extension Build Status

This extension allows you to precisely filter test cases to run with a "natural language"., (*1)

The extension adds a --filter option to atoum. This line now appears on the atoum help:, (*2)

--filter: Filters tests to execute. For example 'not("featureA" in tags) and namespace = "foo\bar"'

You can now filter your tests using any Hoa\Ruler filter., (*3)

Example

./vendor/bin/atoum -d tests --filter 'not("featureA" in tags) and namespace = "foo\bar"'

This will only launch test that are not tagged with "featureA" and have the foo\bar namespace., (*4)

Available filters

Those variables are available in the filter:, (*5)

  • method
  • class
  • namespace
  • testedclass
  • testedclassnamespace
  • tags (as an array)
  • extensions (as an array)

Install it

Install extension using composer:, (*6)

composer require --dev atoum/ruler-extension

The extension will be automatically loaded. If you ever want to unload it, you can add this to your configuration file:, (*7)

<?php

// .atoum.php

use mageekguy\atoum\ruler;

$runner->removeExtension(ruler\extension::class);

Examples

Filter on tags

Run all tests who have the needsDatabase tag:, (*8)

./vendor/bin/atoum -d tests --filter 'tags contains "needsDatabase"'

Run all tests except those who have the needsDatabase tag:, (*9)

./vendor/bin/atoum -d tests --filter 'not (tags contains "needsDatabase")'

You can also use the ruler's default in operator, but in that case that's less readable:, (*10)

./vendor/bin/atoum -d tests --filter 'not ("needsDatabase" in tags)'

Read more about tags in atoum's documentation., (*11)

Filter on the test method name

Run all tests with a method named testMethod1:, (*12)

./vendor/bin/atoum -d tests --filter 'method = "testMethod1'

Run all tests with a method named testMethod1 (using an array representing a list of methods to filter):, (*13)

./vendor/bin/atoum -d tests --filter 'method in ["testMethod1"]'

Filter on the test classname

Run the test with the mageekguy\atoum\ruler\tests\units\testClass1 classname:, (*14)

./vendor/bin/atoum -d tests --filter 'class = "mageekguy\atoum\ruler\tests\units\testClass1'

Filter on the test namespace

Run all tests in the mageekguy\atoum\ruler\tests\units namespace:, (*15)

./vendor/bin/atoum -d tests --filter 'namespace = "mageekguy\atoum\ruler\tests\units'

Filter on the tested class name

Run the tests that test the mageekguy\atoum\ruler\testClass1 class:, (*16)

./vendor/bin/atoum -d tests --filter 'testedclass = "mageekguy\atoum\ruler\testClass1'

Filter on the tested class namespace

Run the tests that test the classes in the mageekguy\atoum\ruler namespace:, (*17)

./vendor/bin/atoum -d tests --filter 'testedclassnamespace = "mageekguy\atoum\ruler'

Filter on the test required extensions

Run all tests that needs the blackfire extension :, (*18)

./vendor/bin/atoum -d tests --filter 'extensions contains "blackfire"'

You can also use the ruler's default in operator, but in that case that's less readable:, (*19)

./vendor/bin/atoum -d tests --filter '"blackfire" in tags'

You can read more about the test required extensions in atoum's documentation., (*20)

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:, (*21)

./vendor/bin/atoum --filter '("needsDatabase" in tags and method = "testClass1") or (method = "testClass")'

License

ruler-extension is released under the MIT License. See the bundled LICENSE file for details., (*22)

atoum, (*23)

The Versions

24/02 2017

dev-master

9999999-dev

The atoum ruler-extension allows you to filter your tests using Hoa\Ruler

  Sources   Download

MIT

The Requires

 

by Adrien Gallou

tdd test unit testing atoum atoum-extension ruler

24/02 2017

1.3.0

1.3.0.0

The atoum ruler-extension allows you to filter your tests using Hoa\Ruler

  Sources   Download

MIT

The Requires

 

by Adrien Gallou

tdd test unit testing atoum atoum-extension ruler

24/02 2017

dev-update-atoum-3

dev-update-atoum-3

The atoum ruler-extension allows you to filter your tests using Hoa\Ruler

  Sources   Download

MIT

The Requires

 

by Adrien Gallou

tdd test unit testing atoum atoum-extension ruler

19/01 2016
24/06 2015

1.0.3

1.0.3.0

  Sources   Download

MIT

The Requires

 

by Adrien Gallou

27/02 2015

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

by Adrien Gallou

21/02 2015

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

by Adrien Gallou

21/02 2015

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

by Adrien Gallou