PHPUnit not working in PHPStorm

I have the following test file, an example on the PHPUnit website.

<?php require_once 'PHPUnit/Autoload.php'; class StackTest extends PHPUnit_Framework_TestCase { public function testPushAndPop() { $stack = array(); $this->assertEquals(0, count($stack)); array_push($stack, 'foo'); $this->assertEquals('foo', $stack[count($stack)-1]); $this->assertEquals(1, count($stack)); $this->assertEquals('foo', array_pop($stack)); $this->assertEquals(0, count($stack)); } } ?> 

I try to run it in PHPStorm 5.0, but I get the following error:

 E:\wamp\bin\php\php5.3.13\php.exe C:\Users\<user>\AppData\Local\Temp\ide-phpunit.php --no-configuration StackTest E:\wamp\www\renting\tests\StackTest.php Testing started at 03:37 ... SCREAM: Error suppression ignored for Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in C:\Users\<user>\AppData\Local\Temp\ide-phpunit.php on line 166 

Any ideas why this happens in C: when I set the include path to E :?

+7
source share
4 answers

I decided!

There seems to be a problem with some dependency, in particular pear.symfony.com/Yaml.

Solved this by doing:

 pear channel-discover pear.symfony.com pear install pear.symfony.com/Yaml pear channel-discover pear.phpunit.de pear install --alldeps pear.phpunit.de/PHPUnit 

The solution idea is taken from: How to properly install PHPUnit with PEAR?

+9
source

For a long time I struggled with a similar problem, which turned out to be a problem of rights.

Here is my solution: stack overflow

Hope this can help other people solve simulation problems faster.

+1
source

My problem was similar, but I solved it by specifying the bootstrap file from the tests. Then everything worked fine.

+1
source

Here is the right solution for JetBrains horrible hack and more.

stack overflow

0
source

All Articles