Open trovster opened 1 month ago
Testbench itself uses PHPStan 1.11 for code analysis and haven't seen this error.
The issue doesn't seem to be with PHPStan 1.11, as I use this on another project and running PHPStan works correctly. However, there seems to be a problem with finding the custom connections. I looked, but I can't see what changes were made between core v8.23.10 and v8.24 which triggers the errors.
There are only PHPStan syntax changes and using getenv('TESTBENCH_WORKING_PATH')
instead of just using getcwd()
to resolve the path. That shouldn't cause any changes to how Laravel is bootstrapped.
I am entirely unsure. Static Analysis shouldn't be running the code, so I don't know why this has become an issue, but with my investigation, it was introduced in the recent testbench-core update, as my test runners worked fine yesterday.
Description:
Since core v8.24 has been installed, running PHPStan throws connection errors. If I lock my composer package to use core v8.23.10 these errors disappear (which requires v8.22.3 of Testbench)
This package defines these connections and merges with a service provider. The tests run correctly.
Steps To Reproduce:
Define database connections and merge them with a service provider Create a test which uses the custom connection Successfully run test on the custom connection Run PHPStan