https://github.com/qase-tms/qase-phpunit
Qase TMS PHPUnit reporter.
https://github.com/qase-tms/qase-phpunit
php phpunit qase reporter tms
Last synced: about 2 months ago
JSON representation
Qase TMS PHPUnit reporter.
- Host: GitHub
- URL: https://github.com/qase-tms/qase-phpunit
- Owner: qase-tms
- License: apache-2.0
- Created: 2021-12-01T10:25:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-11T15:33:05.000Z (3 months ago)
- Last Synced: 2025-03-14T14:04:40.687Z (2 months ago)
- Topics: php, phpunit, qase, reporter, tms
- Language: PHP
- Homepage: https://developers.qase.io
- Size: 2.37 MB
- Stars: 7
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Qase TMS PHPUnit Reporter
Publish test results easily and efficiently.
## Installation
To install the latest version, run:
```sh
composer require qase/phpunit-reporter
```Add the following lines to the `phpunit.xml` file:
```xml
```
## Getting Started
The PHPUnit reporter can auto-generate test cases and suites based on your test data.
Test results of subsequent test runs will match the same test cases as long as their names and file paths don’t change.You can also annotate tests with the IDs of existing test cases from Qase.io before executing them.
This is a more reliable way to bind automated tests to test cases, ensuring they persist when you rename, move, or
parameterize your tests.For example:
```php
assertTrue(true);
}#[
QaseId(123),
Field('description', 'Some description'),
Field('severity', 'major')
]
public function testTwo(): void
{
Qase::attach("/my_path/file.json");
$this->assertTrue(false);
}#[
Suite('Suite one'),
Suite('Suite two')
]
public function testThree(): void
{
Qase::attach((object) ['title' => 'attachment.txt', 'content' => 'Some string', 'mime' => 'text/plain']);
throw new Exception('Some exception');
}
}
```To execute PHPUnit tests and report them to Qase.io, run the command:
```bash
QASE_MODE=testops ./vendor/bin/phpunit
```or, if configured in a script:
```bash
composer test
```A test run will be created and accessible at:
https://app.qase.io/run/QASE_PROJECT_CODE
### Parallel Execution
The reporter supports parallel execution of tests using the `paratest` package.
To run tests in parallel, use the following command:
```bash
QASE_MODE=testops ./vendor/bin/paratest
```## Configuration
Qase PHPUnit Reporter can be configured using:
1. A separate configuration file qase.config.json.
2. Environment variables (which override the values in the configuration file).For a full list of configuration options, refer to
the [Configuration Reference](https://github.com/qase-tms/qase-php-commons/blob/main/README.md#configuration).Example qase.config.json
```json
{
"mode": "testops",
"debug": true,
"testops": {
"api": {
"token": "api_key"
},
"project": "project_code",
"run": {
"complete": true
}
}
}
```## Requirements
We maintain the reporter on LTS versions of PHP.
- php >= 8.1
- phpunit >= 10