https://github.com/zucommunications/php-unit-report-generator-bundle
Take a PHPUnit XML generated file and converts it into an Excel Sheet Report
https://github.com/zucommunications/php-unit-report-generator-bundle
excel php phpunit symfony testing
Last synced: 3 months ago
JSON representation
Take a PHPUnit XML generated file and converts it into an Excel Sheet Report
- Host: GitHub
- URL: https://github.com/zucommunications/php-unit-report-generator-bundle
- Owner: ZuCommunications
- Created: 2024-08-29T16:24:06.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-11-28T17:53:40.000Z (7 months ago)
- Last Synced: 2025-01-28T09:46:25.505Z (5 months ago)
- Topics: excel, php, phpunit, symfony, testing
- Language: PHP
- Homepage:
- Size: 3.39 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# PHPUnit Report Generator Bundle
This Symfony bundle provides a command to generate an Excel report from PHPUnit XML files, summarizing test results in a user-friendly format. The generated report includes detailed information about each test case, including suite name, test case, class name, file, line, assertions, time, and status (Passed/Failed).## Installation
To install this bundle, use Composer:```composer require zucommunications/php-unit-report-generator-bundle```
You may need to add this to your `composer.json`:
```
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ZuCommunications/php-unit-report-generator-bundle"
}
],
```You will need to add a yaml configuration in config/packages, below is an example:
```
report:
output_path: '/var/www/html/public'
```## Usage
Once installed, this bundle adds the phpunit:generate-test-report command to your Symfony project.
To generate a test report, run the following command:```php bin/console phpunit:generate-test-report```
This command will:
1. Execute PHPUnit tests with the --testdox and --log-junit options to generate a report.xml file.
2. Parse the report.xml file.
3. Create an Excel report (report.xlsx) in the specified output directory with a summary of the test results.
Output
4. The generated Excel report will contain two sheets:- Sheet 1: Detailed Test Results
- Columns: Suite Name, Test Case, Class Name, File, Line, Assertions, Time, Passed/Failed
- Sheet 2: Summary
- Total number of test cases
- Number of tests passed
- Number of tests failed## Configuration
By default, the generated report will be saved in the project's root directory. You can customize the output path by passing a different value when initializing the GenerateTestReportCommand in your services configuration.## Example
To generate the test report, run the command in your terminal:```php bin/console phpunit:generate-test-report```
## Requirements
- Symfony 5.4 or later
- PHP 7.4 or later
- PHPUnit 9.5 or later