delta-reporter / phpunit-client
Delta Reporter service for PHPUnit tests
Installs: 38 325
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 2
Requires
- guzzlehttp/guzzle: *
- phpunit/phpunit: ^8.5
- psr/http-message: *
- symfony/yaml: *
This package is auto-updated.
Last update: 2025-06-19 23:23:39 UTC
README
This service is intended to send information from PHPUnit tests to Delta Reporter
Installation
Installing this service is simple as adding it as a dependency to composer
"minimum-stability": "dev", "require-dev": { "delta-reporter/phpunit-client" : "*" },
Configuration
Add listener to phpunit.xml
<listeners> <listener class="DeltaReporter\PHPUnitService" file="vendor/delta-reporter/phpunit-client/src/PHPUnitService.php"> <arguments> <string>HOST URL</string> <string>PROJECT NAME</string> <string>TEST TYPE</string> <boolean>ENABLED</boolean> </arguments> </listener> </listeners>
If the environment variable DELTA_LAUNCH_ID
is not present, a new launch is going to be created on Delta Reporter automatically using the current date as PHPUnit Launch {Y-m-d\TH:i:s}
If you wish to generate a DELTA_LAUNCH_ID to pass it to several types of tests, please check this website
Sending media to Delta Reporter
You can sent images and video to Delta Reporter, these will be displayed in a container into your test
use DeltaReporter\Service\DeltaReporterHTTPService;
abstract class DemoClass extends TestCase
{
private function demoFunction()
{
DeltaReporterHTTPService::saveFileForTest($path, 'img', 'Screenshot description');
}
}
The function saveFileForTest()
requires three parameters:
- FilePath: string = Full path to upload the media file
- Type: string = Type of media, it accept two values 'img' or 'video'
- Description: string = Description of the media file, which is going to be displayed in a container