我有以下测试文件,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));
}
}
?>
Run Code Online (Sandbox Code Playgroud)
我试图在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
Run Code Online (Sandbox Code Playgroud)
任何想法为什么它要去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
Run Code Online (Sandbox Code Playgroud)
该解决方案的想法来自:如何使用PEAR正确安装PHPUnit?
| 归档时间: |
|
| 查看次数: |
8505 次 |
| 最近记录: |