PhpStorm v8.0.3(PS-139.1348,2015年2月12日)
<?php
class MyTest extends PHPUnit_Framework_TestCase
{
public function testOneEqualsOne()
{
$this->assertEquals(1, 1);
}
}
?>
配置单元测试以在PhpStorm中运行
在PhpStorm中运行测试
我收到了错误:
Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in C:\Users\Mike\AppData\Local\Temp\ide-phpunit.php on line 49
Call Stack:
0.0000 372768 1. {main}() C:\Users\Mike\AppData\Local\Temp\ide-phpunit.php:0
0.0000 373120 2. IDE_PHPUnit_Loader::init() C:\Users\Mike\AppData\Local\Temp\ide-phpunit.php:209
0.0120 630736 3. IDE_PHPUnit_Loader::detectPHPUnitVersionId() C:\Users\Mike\AppData\Local\Temp\ide-phpunit.php:196
Fatal error: require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.;C:\wamp\bin\php\php5.5.12\pear') in C:\Users\Mike\AppData\Local\Temp\ide-phpunit.php on line 49
Call Stack:
0.0000 372768 1. {main}() C:\Users\Mike\AppData\Local\Temp\ide-phpunit.php:0
0.0000 373120 2. IDE_PHPUnit_Loader::init() C:\Users\Mike\AppData\Local\Temp\ide-phpunit.php:209
0.0120 630736 3. IDE_PHPUnit_Loader::detectPHPUnitVersionId() C:\Users\Mike\AppData\Local\Temp\ide-phpunit.php:196
Process finished with exit code 255
当我通过CMD运行测试时,一切正常。
问题:如何通过phpunit.phar设置PhpUnit以使其正常工作?
答案 0 :(得分:2)
PhpStorm v8不支持PHPUnit 4.6的PHAR版本。
解决方案: