2012-09-20 37 views
1

PHP單元在運行時跳過所有測試。我正在運行一個開發環境。下面是我的環境:PHPUnit繼續跳過測試 - Win7-64,XAMPP,Yii

  • 的Windows 7專業版64位
  • 的Apache 2.4
  • PHP 5.4.4
  • PHPUnit的3.7.0
  • 硒1.2.8
  • 的Yii 1.1.10

每次我運行Yii的功能(或任何測試),我得到以下輸出。

C:\xampp\htdocs\mm\protected\tests>phpunit --verbose functional 
PHPUnit 3.7.0 by Sebastian Bergmann. 

Configuration read from C:\xampp\htdocs\mm\protected\tests\phpunit.xml 

SSSSSS 

Time: 12 seconds, Memory: 3.50Mb 

There were 6 skipped tests: 

1) SiteTest::testIndex 
Could not connect to the Selenium Server on localhost:4444. 

C:\xampp\php\phpunit:46 

2) SiteTest::testContact 
Could not connect to the Selenium Server on localhost:4444. 

C:\xampp\php\phpunit:46 

3) SiteTest::testLoginLogout 
Could not connect to the Selenium Server on localhost:4444. 

C:\xampp\php\phpunit:46 

4) SiteTest::testIndex 
Could not connect to the Selenium Server on localhost:4444. 

C:\xampp\php\phpunit:46 

5) SiteTest::testContact 
Could not connect to the Selenium Server on localhost:4444. 

C:\xampp\php\phpunit:46 

6) SiteTest::testLoginLogout 
Could not connect to the Selenium Server on localhost:4444. 

C:\xampp\php\phpunit:46 
OK, but incomplete or skipped tests! 
Tests: 6, Assertions: 0, Skipped: 6. 

C:\xampp\htdocs\mm\protected\tests> 

注:前所未見的無法連接到Selenium服務器並沒有改變任何事情。仍然發佈這個問題和調查。

感謝您的幫助!

+1

Selenium JAR仍在運行?它在本地主機上嗎? – ernie

+0

如何驗證硒是否在運行?我之前安裝了PEAR ... – CGSmith105

+1

您需要一個硒​​服務器,它與PHP庫分開:http://seleniumhq.org/docs/03_webdriver.html – ernie

回答

2

RTM。在官方的Yii指南中有一個名爲Functional Testing的章節。它始於:

在閱讀本節之前,建議您閱讀Selenium文檔。

本章與下面的註釋結束,在左旁一大標誌:

提示:執行功能測試之前,硒-RC服務器必須啓動。這可以通過在您的Selenium服務器安裝目錄下執行命令java -jar selenium-server.jar來完成。

+0

非常有見地的Mytskine!你回答了我所有的問題:D! – CGSmith105

+0

@ CGSmith105可能很好地接受這個答案作爲正確的答案。 – Highmastdon