Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/.release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
"include-component-in-tag": true,
"changelog-path": "CHANGELOG.md"
},
"plugin/error-handler": {
"package-name": "testo/error-handler",
"component": "error-handler",
"include-component-in-tag": true,
"changelog-path": "CHANGELOG.md"
},
"bridge/symfony-console": {
"package-name": "testo/bridge-symfony-console",
"component": "bridge-symfony-console",
Expand Down
14 changes: 14 additions & 0 deletions plugin/error-handler/.github/workflows/close-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Close PRs

on:
pull_request_target:
types: [opened, reopened]

permissions:
pull-requests: write

jobs:
close:
uses: php-testo/gh-actions/.github/workflows/close-foreign-prs.yml@v1
with:
upstream-url: https://github.com/php-testo/testo
41 changes: 41 additions & 0 deletions plugin/error-handler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<p align="center">
<a href="https://github.com/php-testo/testo"><img alt="TESTO"
src="https://github.com/php-testo/.github/blob/1.x/resources/logo-full.svg?raw=true"
style="width: 2in; display: block"
/></a>
</p>

<p align="center">Error handler plugin</p>

<div align="center">

[![Documentation](https://img.shields.io/badge/Documentation-blue?style=for-the-badge&logo=gitbook&logoColor=white)](https://php-testo.github.io)
[![Support on Boosty](https://img.shields.io/static/v1?style=for-the-badge&label=&message=Sponsorship&logo=Boosty&logoColor=white&color=%23F15F2C)](https://boosty.to/roxblnfk)

</div>

<br />

> [!IMPORTANT]
> ## 🪞 This is a read-only mirror.
>
> Active development of the Testo project lives in [**php-testo/testo**](https://github.com/php-testo/testo) under `plugin/error-handler/`. This repository is **automatically synchronized** from there on every release.
>
> File issues and pull requests in the [main monorepo](https://github.com/php-testo/testo/issues), not here.

## About

Puts an error handler around every test and records the PHP warnings, notices and deprecations it raises on the test result, so they no longer scroll by while the test passes. Unhandled errors are printed to the stderr channel as PHP would print them, and with `failOnError` any captured error fails the test.

A handler installed before the test, such as an application bootstrap, still runs first. A test that installs its own handler and leaves it in place is reported as Risky unless it declares the change with `#[ExpectErrorHandlerChange]`.

## Install

```bash
composer require --dev testo/error-handler
```

[![PHP](https://img.shields.io/packagist/php-v/testo/error-handler.svg?style=flat-square&logo=php)](https://packagist.org/packages/testo/error-handler)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/testo/error-handler.svg?style=flat-square&logo=packagist)](https://packagist.org/packages/testo/error-handler)
[![License](https://img.shields.io/packagist/l/testo/error-handler.svg?style=flat-square)](https://github.com/php-testo/testo/blob/1.x/LICENSE.md)
[![Total Downloads](https://img.shields.io/packagist/dt/testo/error-handler.svg?style=flat-square)](https://packagist.org/packages/testo/error-handler/stats)
1 change: 1 addition & 0 deletions resources/version.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"plugin/facade": "0.1.1",
"plugin/fiber": "0.1.3",
"plugin/skip": "0.1.1",
"plugin/error-handler": "0.1.0",
"bridge/double": "0.1.2",
"bridge/symfony-console": "0.1.14",
"bridge/infection": "0.1.9",
Expand Down
Loading