在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
而你的問題是? – LazyOne
糟糕,忘記了。我編輯了我的問題。 – jaycode
那麼..基於我從你的輸出(測試運行器)看到的,你已經正確設置它(PHPUnit運行/調試配置)。忽略PHP關於缺少時區的警告(編輯你的php.ini來解決這個問題)......我看到的唯一問題是測試運行器無法找到任何測試運行的事實。爲此 - 請用文件名顯示屏幕截圖(如果公共可用,請給出「vfsStream」的鏈接)。最有可能的測試不遵循標準的命名規則。或者沒有實際選擇測試。 – LazyOne