2013-12-22 29 views
0

在Composer和PHPUnit项目上使用PHPStorm(所有这些工作都已正常工作)如何在“vendor”内的composer插件上运行PHPUnit测试,在这种情况下是mikey179/vfsStream?运行phpunit测试作曲家插件vfsStream

我的项目结构如下:

myscripts/ 
vendor/ 
- mikey179 
    - vfsStream 
composer.json 

我想运行PHPUnit的测试vfsStream插件。

我能够在我自己的测试代码(外部供应商目录)上运行测试。

当我运行PHPUnit的测试(上边那个绿色的小播放按钮)我有以下几点:

usr/bin/php /tmp/ide-phpunit.php --bootstrap /path/to/project/vendor/autoload.php --configuration /path/to/project/vendor/mikey179/vfsStream/phpunit.xml.dist /path/to/project/vendor/mikey179/vfsStream 
Testing started at 5:53 PM ... 
PHPUnit 3.8-g8d770d8 by Sebastian Bergmann. 

Configuration read from /path/to/project/vendor/mikey179/vfsStream/phpunit.xml.dist 



Time: 2.22 seconds, Memory: 2.25Mb 

No tests executed! 

PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /path/to/project/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML.php on line 127 
PHP Stack trace: 
PHP 1. {main}() /tmp/ide-phpunit.php:0 
PHP 2. IDE_Base_PHPUnit_TextUI_Command::main() /tmp/ide-phpunit.php:506 
PHP 3. PHPUnit_TextUI_Command->run() /tmp/ide-phpunit.php:268 
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /path/to/project/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:173 
PHP 5. PHP_CodeCoverage_Report_HTML->process() /path/to/project/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:465 
PHP 6. date() /path/to/project/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML.php:127 
Generating code coverage report in HTML format ... done 

Process finished with exit code 0 
+0

而你的问题是? – LazyOne

+0

糟糕,忘记了。我编辑了我的问题。 – jaycode

+0

那么..基于我从你的输出(测试运行器)看到的,你已经正确设置它(PHPUnit运行/调试配置)。忽略PHP关于缺少时区的警告(编辑你的php.ini来解决这个问题)......我看到的唯一问题是测试运行器无法找到任何测试运行的事实。为此 - 请用文件名显示屏幕截图(如果公共可用,请给出“vfsStream”的链接)。最有可能的测试不遵循标准的命名规则。或者没有实际选择测试。 – LazyOne

回答

0

从我看到它与PhpStorm的助手/包装脚本/tmp/ide-phpunit.php),一个问题,它用于集成目的(实时跟踪测试进展 - 消息必须以特定方式格式化;等等)。

测试文件没有标准和预期Test.php结束 - 而不是他们的自定义TestCase.php ..和辅助脚本似乎无法正确地应用从phpunit.xml.dist文件配置选项(它只会搜索*Test.php文件)。

如果重命名所有*TestCase.php文件是*Test.php将开始在PhpStorm工作(我已经改名短短..和他们得到了检测,并执行就好了)。


现在,我只能建议如上所述要么改名测试文件(这是不是在长期来看是一个好主意,如果你打算运行定期的测试,并保留下载该库的最新源)或向PhpStorm问题跟踪器提交错误票证说明情况:http://youtrack.jetbrains.com/issues/WI并希望开发人员尽快解决。