7

I have the following test file, an example on PHPUnit's 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 am trying 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 it is going to C: when I have set the include path to E: ?

1
  • This question is similar to: How do I correctly install PHPUnit with PEAR?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Dec 11, 2024 at 15:32

2 Answers 2

9

It seems that there was a problem with some dependency, specifically pear.symfony.com/Yaml. I solved it 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 idea for the solution came from: How do I correctly install PHPUnit with PEAR?

Sign up to request clarification or add additional context in comments.

1 Comment

Just wanted to leave this here: End of Life for PEAR Installation Method
1

My problem was similar - but i resolved this by pointing the bootstrap file from tests. Then, everything worked just fine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.