| Q |
A |
| PHPUnit version |
11.2+ |
| PHP version |
8.2+ |
| Installation Method |
Composer |
Summary
Hi,
Since PHPUnit 11.2, I have issue when I want mock Symfony Process. I have no issue with PHPUnit 11.1 and priors versions.
Current behavior
When a mock the Symfony Process class, when I call a method on an instance of this mock, I have the error :
_Typed property MockObject_Process_XXXX::$_phpunit_state must not be accessed before initialization
I had test with define an expects() on the mock, but I had always the error.
There was 1 error:
- Test\IssueTest::testBug
Error: Typed property MockObject_Process_62f16cad::$__phpunit_state must not be accessed before initialization
How to reproduce
I have reproducted the issue in this repository https://github.com/frenchcomp/test_phpunit_11_2_process
You can run the test case in the src folder : vendor/bin/phpunit src/IssueTest.php
Summary
Hi,
Since PHPUnit 11.2, I have issue when I want mock Symfony Process. I have no issue with PHPUnit 11.1 and priors versions.
Current behavior
When a mock the Symfony Process class, when I call a method on an instance of this mock, I have the error :
_Typed property MockObject_Process_XXXX::$_phpunit_state must not be accessed before initialization
I had test with define an expects() on the mock, but I had always the error.
There was 1 error:
Error: Typed property MockObject_Process_62f16cad::$__phpunit_state must not be accessed before initialization
How to reproduce
I have reproducted the issue in this repository https://github.com/frenchcomp/test_phpunit_11_2_process
You can run the test case in the src folder :
vendor/bin/phpunit src/IssueTest.php