chiefmyron / phpunit-test-workbench

An extension to integrate PHPUnit with the native Test Explorer functionality within VS Code. Zero configuration required for common environment setups.
https://marketplace.visualstudio.com/items?itemName=chiefmyron.phpunit-test-workbench
MIT License
5 stars 2 forks source link

unexpected error: Unable to resolve resource phar:/Users/... #75

Closed FrankCoder closed 10 months ago

FrankCoder commented 10 months ago

At the end of a test with some exception thrown, the editor is trying to open a window and I get the resulting error message:

The editor could not be opened due to an unexpected error: Unable to resolve resource phar:/Users/jf/WebSites/toast-software/projects/riap/src/php/tools/phpunit.phar/phpunit/Framework/TestCase.php

Here's my configuration:

"phpunit-test-workbench.php.binaryPath": "/Applications/MAMP/bin/php/php8.2.4/bin/php",
"phpunit-test-workbench.log.displayFailuresAsErrorsInCode": true,
"phpunit-test-workbench.log.level": "debug",
"phpunit-test-workbench.phpunit.binaryPath": "/Users/jf/WebSites/toast-software/projects/riap/src/php/tools/phpunit.phar",
"phpunit-test-workbench.phpunit.locatorPatternConfigXml": "**/tools/phpunit.xml",
"phpunit-test-workbench.phpunit.testDirectory": "tests",
"phpunit-test-workbench.phpunit.testNamespacePrefix": "ToastPHP\\Tests\\",
"phpunit-test-workbench.xdebug.clientPort": 9000,
"phpunit-test-workbench.xdebug.clientHost": "localhost",
"phpunit-test-workbench.phpunit.testOrganization": "namespace",

Any help would be appreciated.

Thanks.

chiefmyron commented 10 months ago

Hi @FrankCoder - it looks like this is a VS Code error message, not something triggered by the extension.

It seems as if your test may have triggered an exception within PHPUnit itself - specifically the TestCase class. Since you are running PHPUnit via the PHAR library, VS Code is unable to open the TestCase class within the .phar file to display the details of the exception.

FrankCoder commented 10 months ago

Yes, I finally figured that out. Bit of an annoyance this is.