PHPUnit
PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks. PHP unit can generate standard format JUnit-style XML files which can be submited to Testfiesta or Testrail using taco truck cli. You just need to install the popular Go testify
, Gotestsum and install tacotruck cli or use Github action. Check out simple PHPUnit example.
Generate xml report file
To generate xml file report of the test logger and log file path should be included in command
./vendor/bin/phpunit --log-junit=test-reports/test-results.xml
Install Tacotruck CLI
$ npm install -g @testfiesta/tacotruck
Submit test results
tacotruck testfiesta \
run:submit \
--token testfiesta_... \
--handle orgHandle \
--project projectKey \
--name runName \
--data results-path/*.xml
Github action
name: phpunit
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2
coverage: xdebug
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Tests
run: ./vendor/bin/phpunit --log-junit=test-reports/test-results.xml
- name: Report Results
uses: testfiesta/tacotruck-action@v1
with:
provider: testfiesta
handle: handle
project: project
base-url: https://api.testfiesta.com
credentials: ${{ secrets.TESTFIESTA_API_KEY }}
run-name: PHPUnit CI run ${{ github.run_number }}
Last updated