PHPUnit在phpForm中不工作
我有以下测试文件,PHPUnit网站上的一个示例PHPUnit在phpForm中不工作,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));
<?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
E:\wamp\bin\php\php5.3.13\php.exe C:\Users\\AppData\Local\Temp\ide-phpunit.php——无配置StackTest E:\wamp\www\renting\tests\StackTest.php
测试于03:37开始。。。
尖叫:已忽略对的错误抑制
警告:require_once(PHPUnit/Runner/Version.php):无法打开流:第166行的C:\Users\\AppData\Local\Temp\ide-PHPUnit.php中没有此类文件或目录
当我将include路径设置为E:,你知道为什么会是C:?解决了它
似乎有些依赖性存在问题,特别是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
解决方案的想法来源于:我与类似的问题斗争了很长一段时间,结果是一次配股 以下是我的解决方案:
希望它能帮助其他人更快地解决类似问题。我的问题与此类似,但我通过指向测试中的引导文件解决了这个问题。然后,一切都很顺利。以下是针对JetBrains可怕的黑客攻击等问题的正确解决方案
我只想把这个留在这里: