pestphp / pest

Pest is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
https://pestphp.com
MIT License
9.48k stars 343 forks source link

[Bug]: Using Pest 2.5.3 or higher with orchestra/testbench 8.15 or higher results in #1067

Open jamiethorpe opened 8 months ago

jamiethorpe commented 8 months ago

What Happened

When running tests, I started getting this warning:

INFO  Warning: class_implements(): Class AllowDynamicProperties does not exist and could not be loaded in /path/to/vendor/orchestra/testbench-core/src/PHPUnit/AttributeParser.php on line 82.

To be honest, I'm not sure if this is something that should be changed in pest or in testbench.

How to Reproduce

Install a fresh Laravel app Add Pest

require --dev orchestra/testbench

Change TestCase.php to extend \Orchestra\Testbench\TestCase

Change the default ExampleTest.php in Feature and Unit to a pest test:

it('can pass a test', function () {
    expect(true)->toBeTrue();
});

This should result in the warning being printed. Changing pest to version 2.5.2 gets rid of the warning.

Sample Repository

https://github.com/jamiethorpe/pest-testbench-testing

Pest Version

Anything higher than 2.5.2

PHP Version

8.1.26

Operation System

macOS, Linux

Notes

No response