我正在嘗試使用Visual PHPUnit。如何實現PHPUnit
當我使用phpunit
命令時它的運行很好。沒有錯誤發生,我的測試成功運行。的phpunit --version
輸出如下:
PHPUnit 4.0.14 by Sebastian Bergmann.
我使用PEAR安裝PHPUnit的。的which pear
輸出如下:
/usr/bin/pear
在線#9 app/config/bootstrap.php
視覺的PHPUnit的,我設置/usr/bin/pear
爲pear_path
。
出現下面的錯誤,當我嘗試從瀏覽器中運行VPU ...
Warning: require_once(PHPUnit/Autoload.php): failed to open stream: No such file or directory in /path_to_vpu/app/config/bootstrap.php on line 83
Fatal error: require_once(): Failed opening required 'PHPUnit/Autoload.php' (include_path='.:/usr/share/php:/usr/bin/pear:/path_to_vpu:/usr/share/php') in /path_to_vpu/app/config/bootstrap.php on line 83
的which php
輸出如下:
/usr/bin/php
我的服務器是Ubuntu 13.10 Saucy
。的php -v
輸出如下:
PHP 5.5.3-1ubuntu2.2 (cli) ....
的pear list -c phpunit
輸出如下:
INSTALLED PACKAGES, CHANNEL PEAR.PHPUNIT.DE:
============================================
PACKAGE VERSION STATE
DbUnit 1.3.1 stable
File_Iterator 1.3.4 stable
PHPUnit 4.0.14 stable
PHPUnit_Selenium 1.3.3 stable
PHPUnit_Story 1.0.2 stable
PHPUnit_TicketListener_GitHub 1.0.0 stable
PHP_CodeCoverage 1.2.17 stable
PHP_Invoker 1.1.3 stable
PHP_Timer 1.0.5 stable
PHP_TokenStream 1.2.2 stable
Text_Template 1.2.0 stable
我的問題是,爲什麼我不能包括PHPUnit/Autoload.php
?請幫助我...如果你需要了解我的配置,請問我...
在此先感謝。
編輯
我的php.ini文件(包括CLI和Web)有以下幾點:
include_path中= 「:在/ usr /共享/ PHP:在/ usr /共享/梨」
該文件存在於/ usr/bin/pear/PHPUnit/Autoload.php中嗎?無論如何,我建議使用[composer](https://getcomposer.org/)來安裝依賴關係。 – Phil
/usr/bin/pear是這裏的一個文件... – Tareq
然後你的'include_path'配置不正確。它應該只包含目錄,而不是文件 – Phil