yii中的require_once(PHPUnit / Extensions / SeleniumTestCase.php)

时间:2014-07-13 10:22:10

标签: phpunit composer-php yii-components

我正试图在yii中使用phpunit

我按照说明从http://phpunit.de/manual/4.1/en/installation.html

安装它

当我这样做时

phpunit protected/tests/unit/

发生此错误

PHP Warning:  require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/news/framework/test/CWebTestCase.php on line 12

当我试图再次安装SeleniumTestCase时抛出

composer global require "phpunit/phpunit-selenium": ">=1.2"

这就是出现的

Changed current directory to /home/qts1234/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev) 
Nothing to install or update 
Generating autoload files 

我该怎么办?请帮忙

1 个答案:

答案 0 :(得分:1)

使用composer全局安装selenium脚本不会将它们添加到包含路径中,也不会被自动加载器看到。

您应该添加phpunit/phpunit-selenium作为开发依赖项,并让作曲家将其安装到您的项目中,这样您的引导程序就可以加载自动加载器,并且可以找到您正在扩展的测试。