Skip to content

Instantly share code, notes, and snippets.

@colinodell
Created September 14, 2020 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinodell/e29d3166168b0f04669750c05441c396 to your computer and use it in GitHub Desktop.
Save colinodell/e29d3166168b0f04669750c05441c396 to your computer and use it in GitHub Desktop.
Make PHPUnit beep at you any time a test fails
<?php declare(strict_types=1);
namespace Vendor;
use PHPUnit\Runner\AfterTestErrorHook;
final class BeepExtension implements AfterTestErrorHook
{
public function executeAfterTestError(string $test, string $message, float $time): void
{
echo "\x07"; // emit BEL
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment