PHPUnit在PHPStorm中不起作用

前端之家收集整理的这篇文章主要介绍了PHPUnit在PHPStorm中不起作用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有以下测试文件,PHPUnit网站上的一个例子.
<?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));
    }
}
?>

我试图在PHPStorm 5.0中运行它,但我收到以下错误

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

任何想法为什么它要去C:当我设置包含路径到E:?

解决了!

似乎某些依赖存在问题,特别是pear.symfony.com/Yaml.

解决它做:

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

解决方案的想法来自:How do I correctly install PHPUnit with PEAR?

原文链接:https://www.f2er.com/php/134309.html

猜你在找的PHP相关文章