Add phpUnit testing for Amazon Incentives class
This commit is contained in:
21
test/phpUnit/Hook/BypassFinalHook.php
Normal file
21
test/phpUnit/Hook/BypassFinalHook.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
// strip the final name from a to be mocked class
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace test\phpUnit\Hook;
|
||||
|
||||
use DG\BypassFinals;
|
||||
use PHPUnit\Runner\BeforeFirstTestHook;
|
||||
|
||||
// only works if it is the FIRST load and not before EACH test
|
||||
final class BypassFinalHook implements BeforeFirstTestHook
|
||||
{
|
||||
public function executeBeforeFirstTest(): void
|
||||
{
|
||||
BypassFinals::enable();
|
||||
}
|
||||
}
|
||||
|
||||
// __END__
|
||||
Reference in New Issue
Block a user