I am running phpStorm 7.1.3 version on Windows 7 and I have done everything accordingly to install composer and then phpunit. Now I have it in vendors directory. But every time I run my program which is a simple Yii application I get the same error.
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar 'C:/wamp/www/myproject/vendor/bin/phpunit', file extension (or combination) not recognised or the directory does not exist' in C:\Users\myUser\AppData\Local\Temp\ide-phpunit.php:177
Please help, I am stuck here already two days and cant get this working, almost changed and reinstalled everything but is not helping.
I didn't use pear, I downloaded everything through the phpStorm. I downloaded composer, and after that through phpStorm composer I downloaded phpUnit 3.7.37.
Here is the screenshot of my settings for composer
Here is the content of my composer.json
{
"require": {
"phpunit/phpunit": "3.7.37"
}
}
Here is the screenshot of my settings for PHPunit
On your 2nd screenshot (PHPUnit settings):
.../bin/phpunit
(even if you choose 3rd option .. you should point it to a PHAR file then)?Therefore:
Related (similar issue): https://stackoverflow.com/a/17316104/783119
If you are not using composer, but the 'Path to phpunit.phar' option and still receive this error, just make sure the path you specify ends with a .phar (usually ends with phpunit.phar) I was seeing this same error but because I had the path pointing to my command-line alias, not the actual .phar file, it gets hung up on the improper extension and bails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With