> For the complete documentation index, see [llms.txt](https://docs.testfiesta.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testfiesta.com/automation/testing-tools/php/pestphp.md).

# PestPHP

<figure><img src="/files/xIEkbryOebLvwFSz3hvH" alt=""><figcaption></figcaption></figure>

Pest is a testing framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP. Pest  can  generate standard format JUnit-style XML files  which can be  submitted  to Testfiesta or Testrail using taco truck cli. You just need to install the popular [`Pest`](https://pestphp.com/docs/installation) and install Tacotruck  CLI or use [Github action](https://github.com/testfiesta/tacotruck-action).  Check out simple pest [example](https://github.com/testfiesta/tacotruck-examples/tree/main/demo-pestphp-tf).

### Configuration

To generate xml file  report  of the test logger and log file path should be included in command&#x20;

```sh
./vendor/bin/phpunit --log-junit=test-reports/test-results.xml
```

### Install Tacotruck CLI

{% code overflow="wrap" fullWidth="false" %}

```sh
$ npm install -g @testfiesta/tacotruck
```

{% endcode %}

### Submit test results

{% tabs %}
{% tab title="Testfiesta" %}

```sh
tacotruck testfiesta \
  run:submit \
  --token testfiesta_... \
  --handle orgHandle \
  --project projectKey \
  --name runName \
  --data results-path/*.xml
```

{% endtab %}
{% endtabs %}

### Github Action

{% tabs %}
{% tab title="Testfiesta" %}

```yaml
name: pestphp

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.2
          tools: composer:v2
          coverage: xdebug

      - name: Install Dependencies
        run: composer install --no-interaction --prefer-dist --optimize-autoloader

      - name: Tests
        run: ./vendor/bin/pest --ci --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://staging.api.testfiesta.com
         credentials: ${{ secrets.TESTFIESTA_API_KEY }}
         run-name: PestPHP CI run ${{ github.run_number }}

```

{% endtab %}
{% endtabs %}

### Support and Resources

* [TacoTruck Examples](https://github.com/testfiesta/tacotruck-examples)
* [PestPHP Docs](https://pestphp.com/docs/pest-v4-is-here-now-with-browser-testing)
* [Tacotruck Issues](https://github.com/testfiesta/tacotruck/issues)
* [**CLI Reference**](/automation/tacotruck-cli.md)
* [Tacotruck Github Action](https://github.com/testfiesta/tacotruck-action)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.testfiesta.com/automation/testing-tools/php/pestphp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
