【问题标题】:PHPUnit keeps skipping tests - Win7-64, XAMPP, YiiPHPUnit 不断跳过测试 - Win7-64、XAMPP、Yii
【发布时间】:2012-09-12 22:38:56
【问题描述】:

PHP 单元在运行时跳过了所有的测试。我正在运行一个开发环境。这是我的环境:

  • 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 服务器的消息,也没有改变任何事情。仍在发布此问题并进行调查。

感谢您的帮助!

【问题讨论】:

  • Selenium JAR 还在运行吗?它在本地主机上吗?
  • 如何验证 selenium 是否正在运行?我之前用 PEAR 安装过...
  • 你需要一个 selenium 服务器,它独立于 PHP 库:seleniumhq.org/docs/03_webdriver.html

标签: php selenium yii phpunit


【解决方案1】:

RTM。在 Yii 官方指南中有一个名为 Functional Testing 的章节。开头是:

在阅读本节之前,建议您阅读 Selenium 文档。

本章以以下注释结束,左边距有一个大标记:

提示:在运行功能测试之前,必须启动 Selenium-RC 服务器。这可以通过在 Selenium 服务器安装目录下执行命令 java -jar selenium-server.jar 来完成。

【讨论】:

  • 非常有见地的 Mytskine!你回答了我所有的问题:D!
  • @CGSmith105 可能会接受这个答案作为正确答案。
猜你喜欢
  • 1970-01-01
  • 2012-05-01
  • 2015-11-27
  • 2013-02-02
  • 2014-06-09
  • 2011-12-16
  • 2017-12-05
  • 2016-10-29
相关资源
最近更新 更多