簡體   English   中英

Yii phpunit錯誤SeleniumTestCase.php無法打開流

[英]Yii phpunit error SeleniumTestCase.php fail to open stream

我已根據此網站(右側菜單欄中的“ Windows”子菜單)中的Yii指示安裝了phpunit:

https://phpunit.de/manual/current/zh/installation.html

當我運行數據庫連接測試時:

phpunit unit/DbTest.php

我收到以下錯誤:

require_once(PHPUnit/Extensions/SeleniumTestCase.php) failed to open stream. No such file or directory in C:/wamp/www/yii/framework/test/CWebTestCase.php on line 12

然后,我搜索了錯誤並嘗試了以下指示(無效)
1.使用梨安裝phpunit(不再受支持)
2.從github下載phpunit / extension文件夾,並將其放在我的C:/ wamp / www / yii / framework / test /中。 然后錯誤變為:

Cannot redeclare class PHPUnit_Extensions_SeleniumTestCase in C:\wamp\www\yii\framework\test\PHPUnit\Extensions\SeleniumTestCase.php on line 1217 

我該如何解決? 我正在將Windows 8與wamp服務器一起使用。

我遇到了同樣的問題,並按照與您包括的步驟完全相同的步驟進行操作; 嘗試梨,並將PHPUnit文件夾放入測試中。
要解決您的最終錯誤,您只需在以下行中注釋掉以下行(在我的代碼中,該行在第12行):
yii-framework / framework / test / CWebTestCase.php

//require_once('PHPUnit/Extensions/SeleniumTestCase.php');

嘗試

pear upgrade -f phpunit/phpunit_selenium

希望對您有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM