Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/genkiroid/phpunit-filter-blocker
PHPUnitFilterBlocker is custom implementation of PHPUnit Framework TestListener.
https://github.com/genkiroid/phpunit-filter-blocker
phpunit phpunit-listener
Last synced: 9 days ago
JSON representation
PHPUnitFilterBlocker is custom implementation of PHPUnit Framework TestListener.
- Host: GitHub
- URL: https://github.com/genkiroid/phpunit-filter-blocker
- Owner: genkiroid
- License: mit
- Created: 2020-02-16T13:20:08.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-28T01:16:09.000Z (about 2 years ago)
- Last Synced: 2025-01-18T02:36:33.740Z (15 days ago)
- Topics: phpunit, phpunit-listener
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHPUnitFilterBlocker
PHPUnitFilterBlocker is custom implementation of PHPUnit Framework TestListener. It mainly blocks PHPUnit's filter option to prevent misconfiguration in CI.
![CI](https://github.com/genkiroid/phpunit-filter-blocker/workflows/CI/badge.svg?branch=master)
## Installation
```
$ composer require genkiroid/phpunit-filter-blocker
```## Settings
To attach PHPUnitFilterBlocker as test listener, add following element to phpunit.xml. (Parent element is ``.)
```xml
false
false
```
If you want to block `--group` and `--exclude-group` options too, change `false` to `true` setting value above.
## About blocking
Block test case specification. (Fixed)
```
$ vendor/bin/phpunit tests/exampleTest.php
PHPUnit 9.0.1 by Sebastian Bergmann and contributors.Test case specification has been disabled by phpunit-filter-blocker. Stopped phpunit.
```Block `--filter` option. (Fixed)
```
$ vendor/bin/phpunit tests/ --filter="Hello"
PHPUnit 9.0.1 by Sebastian Bergmann and contributors.--filter option has been disabled by phpunit-filter-blocker. Stopped phpunit.
```Block `--group` option. (Option)
```
$ vendor/bin/phpunit tests/ --group=hello
PHPUnit 9.0.1 by Sebastian Bergmann and contributors.--group option has been disabled by phpunit-filter-blocker. Stopped phpunit.
```Block `--exclude-group` option. (Option)
```
$ vendor/bin/phpunit tests/ --exclude-group=hello
PHPUnit 9.0.1 by Sebastian Bergmann and contributors.--exclude-group option has been disabled by phpunit-filter-blocker. Stopped phpunit.
```No blocking example.
```
$ vendor/bin/phpunit tests/
PHPUnit 9.0.1 by Sebastian Bergmann and contributors... 2 / 2 (100%)
Time: 83 ms, Memory: 6.00 MB
OK (2 tests, 2 assertions)
```