Skip to content

Commit

Permalink
added PHPUnitExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 19, 2023
1 parent c3a0b0b commit efe2fe0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ You can try to increase performance by using the cache (the directory must exist
DG\BypassFinals::setCacheDirectory(__DIR__ . '/cache');
```

To register BypassFinals in PHPUnit 10, simply add the extension to the PHPUnit XML configuration file:

```xml
<extensions>
<bootstrap class="DG\BypassFinals\PHPUnitExtension"/>
</extensions>
```

Support Project
---------------

Expand Down
24 changes: 24 additions & 0 deletions src/PHPUnitExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

Check failure on line 1 in src/PHPUnitExtension.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class PHPUnit\Runner\Extension\Extension not found.

declare(strict_types=1);

namespace DG\BypassFinals;

use DG\BypassFinals;
use PHPUnit\Runner\Extension\Extension;
use PHPUnit\Runner\Extension\Facade;
use PHPUnit\Runner\Extension\ParameterCollection;
use PHPUnit\TextUI\Configuration\Configuration;


final class PHPUnitExtension implements Extension
{
public function bootstrap(
Configuration $configuration,
Facade $facade,
ParameterCollection $parameters
): void
{
BypassFinals::enable();
}
}

0 comments on commit efe2fe0

Please sign in to comment.