2015-11-06 61 views
0

我需要一些支持。 :)我如何運行symfonys測試?

我克隆symfony的/ symfony的回購,跑composer update並試圖運行測試時,我得到這樣的:

[emil:~/Development/symfony](2.8) $ php ./phpunit symfony 

Warning: require(/Users/emil/Development/symfony/.phpunit/phpunit-4.8/vendor/autoload.php): failed to open stream: No such file or directory in /Users/emil/Development/symfony/.phpunit/phpunit-4.8/phpunit on line 4 

Fatal error: require(): Failed opening required '/Users/emil/Development/symfony/.phpunit/phpunit-4.8/vendor/autoload.php' (include_path='.:') in /Users/emil/Development/symfony/.phpunit/phpunit-4.8/phpunit on line 4 
PHP Warning: require(/Users/emil/Development/symfony/.phpunit/phpunit-4.8/vendor/autoload.php): failed to open stream: No such file or directory in /Users/emil/Development/symfony/.phpunit/phpunit-4.8/phpunit on line 4 
PHP Fatal error: require(): Failed opening required '/Users/emil/Development/symfony/.phpunit/phpunit-4.8/vendor/autoload.php' (include_path='.:') in /Users/emil/Development/symfony/.phpunit/phpunit-4.8/phpunit on line 4 
KO src/Symfony/Bridge/Doctrine 

我的PHP版本:

[emil:~/Development/symfony](2.8) $ php -v 
PHP 5.5.30 (cli) (built: Oct 3 2015 23:48:03) 
Copyright (c) 1997-2015 The PHP Group 
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies 

我在OS X 10.11.1。有沒有人有什麼建議?

到目前爲止,我所做的唯一的事情就是克隆回購,按照本指南:https://symfony.com/doc/current/contributing/code/tests.html

回答

0

看起來這是由一個錯誤引起的。

我的作曲家安裝在bash包裝中。 phpunit腳本試圖用php執行phpunit。

這個PR應該修好了。

手動修復是下載composer.phar並將其放置在.phpunit/phpunit-4.8目錄中。

0

使用vendor/phpunit/phpunit/phpunit -c phpunit.xml.dist

在您phpunit.xml.dist定義路徑到您的bootstrap.php和測試源(經調整的路徑):

<testsuites> 
<testsuite name="Project Test Suite"> 
    <directory>vendor/symfony/symfony/src/*/*Bundle/Tests</directory> 
    <directory>vendor/symfony/symfony/src/*/Bundle/*Bundle/Tests</directory> 
</testsuite> 
</testsuites>