Selenium zendstudio运行含硒的phpunit

Selenium zendstudio运行含硒的phpunit,selenium,phpunit,zend-studio,Selenium,Phpunit,Zend Studio,Windows 8.1上的Zend Studio 10.6.1: 如何在Zend Studio(版本10.6.1)中运行PHPUnit Selenium? Zend Studio 10.6.1有内置版本的PHPUnit 3.7,但没有安装PHPUnit selenium软件包。 我尝试在我的PHP项目中安装phpunit selenium,但没有成功 作为phar归档文件安装(从phpunit网站下载phpunit.phar) 在我的PHP项目中随composer一起安装(要求:phpunit

Windows 8.1上的Zend Studio 10.6.1:

如何在Zend Studio(版本10.6.1)中运行PHPUnit Selenium? Zend Studio 10.6.1有内置版本的PHPUnit 3.7,但没有安装PHPUnit selenium软件包。 我尝试在我的PHP项目中安装phpunit selenium,但没有成功

  • 作为phar归档文件安装(从phpunit网站下载phpunit.phar)
  • 在我的PHP项目中随composer一起安装(要求:phpunit selenium>=1.3.3)
  • 解包phar归档并将其包含在我的项目中
  • 在我的项目中安装了完整的当前PHPUnit包(版本4.1)
结果是要么找不到PHPUnit Selenium类,要么测试无法运行,要么PHPUnit根本就没有在Zend Studio中运行


我将通过描述如何解决这个问题来回答这个问题。一个干净的解决方案是在Zend Studio的内置PHPUnit中编辑composer.json。 Windows下Zend Studio内置PHPUnit的路径为:

c:\Program Files (x86)\Zend\Zend Studio 10.6.1\plugins\com.zend.php.phpunit_10.6.1.v20140329-2132\resources\vendor\phpunit\phpunit
和/或:

c:\Program Files (x86)\Zend\Zend Studio 10.6.1\plugins\com.zend.php.phpunit_10.6.1.v20140329-2132\resources\vendor\phpunit\phpunit.org
似乎有两个相同的版本

然而,在尝试了一些composer之后,我无法解决错误消息,于是放弃了。我希望将来能解决这个问题,因为这将是一个更干净的解决方案

以下是一个成功的解决方法:

  • 在项目中通过composer安装phpunit selenium
  • 将文件复制到Zend Studio的内置PHPUnit
  • 编辑项目目录下的文件vendor\composer\autoload_classmap.php:
    • 找到以“PHPUnit_Extensions_Selenium”开头的行,并将它们复制到剪贴板
  • 编辑文件c:\Program Files(x86)\Zend\Zend Studio 10.6.1\plugins\com.Zend.php.phpunit\u 10.6.1.v20140329-2132\resources\vendor\composer\autoload\u classmap.php:
    • 粘贴以“PHPUnit_Extensions_Selenium”开头的复制行
  • 从项目中的composer和项目中删除phpunit selenium
您为什么在此处发布问题?即使你知道答案。您发布了问题,并在同一分钟内回答了它。只有当你们真的不知道答案的时候,你们才应该问这个问题。当你们发帖的时候,你们可以自己回答。原因是其他有类似问题的人可以发现这一点。