Skip to content

php-testo/filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TESTO

Test filtering plugin

Documentation Support on Boosty


Important

🪞 This is a read-only mirror.

Active development of the Testo project lives in php-testo/testo under plugin/filter/. This repository is automatically synchronized from there on every release.

File issues and pull requests in the main monorepo, not here.

About

Selects which tests run on a given invocation by name patterns, paths, suites, types, dataset pointers, and groups. Powers Testo's --filter, --path, --suite, --type, and --group CLI flags.

Groups

Label tests with the #[Group] attribute and select them with --group:

use Testo\Filter\Group;
use Testo\Test;

#[Test]
#[Group('integration')]      // every test of this class inherits "integration"
final class OrderTest
{
    #[Group('slow')]         // groups: integration, slow
    public function importsLargeDataset(): void { /* ... */ }

    public function createsOrder(): void { /* ... */ } // groups: integration
}

The attribute targets classes, methods, and functions and accepts several names at once (#[Group('db', 'slow')]). A test's group set is the union of all groups reachable from it: its own method (and any overridden parent method), the test class, its parent classes, and traits.

# Run only tests in the "db" or "integration" group (OR logic)
./vendor/bin/testo run --group=db --group=integration

# Exclude a group with the "!" prefix (run everything except "slow")
./vendor/bin/testo run --group=!slow

# Combine with other filters (AND between filter types)
./vendor/bin/testo run --group=db --filter=OrderTest

Exclusion (!) takes precedence over inclusion. Group filters combine with name/path/suite/type filters using AND logic.

Install

composer require --dev testo/filter

PHP Latest Version on Packagist License Total Downloads

About

Test filtering plugin for the Testo testing framework (split-published from php-testo/testo)

Resources

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages