简体   繁体   English

PHPUnit Selenium/Ubuntu 的致命错误

[英]PHPUnit Fatal Error with Selenium/Ubuntu

I have gone through various tutorials/posts to install PHPUnit with Selenium on my Ubuntu system.我已经通过各种教程/帖子在我的 Ubuntu 系统上安装 PHPUnit 和 Selenium。 I believe I have everything setup as required:我相信我已按要求设置了所有内容:

/usr/share/php$ phpunit --version
PHPUnit 3.6.10 by Sebastian Bergmann.

So using the IDE I create my test, and save it for running, which appears to be setup as required.因此,我使用 IDE 创建了我的测试,并将其保存以供运行,这似乎是根据需要设置的。 So I run the test using:所以我运行测试使用:

phpunit /home/retrobadger/working_files/tutorials/phpunit/selenium1.php

But everytime I run it, I get the error below:但是每次运行它时,我都会收到以下错误:

PHP Fatal error:  Class 'PHPUnit_Extensions_SeleniumTestSuite' not found in /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php on line 394
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:130
PHP   4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/share/php/PHPUnit/TextUI/Command.php:150
PHP   5. ReflectionMethod->invoke() /usr/share/php/PHPUnit/Runner/BaseTestRunner.php:124
PHP   6. PHPUnit_Extensions_SeleniumTestCase::suite() /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php:0

The file in extensions exists, and I have set very open priviledges to it. extensions里面的文件是存在的,我给它设置了非常开放的权限。 The only things I can think of are that either my SeleniumTestCase.php is faulty, or that I need to require another file no other tutorials have suggested.我唯一能想到的是我的 SeleniumTestCase.php 有问题,或者我需要其他教程没有建议的另一个文件。

Any recommendations would be greatly appreciated.任何建议将不胜感激。 I have little experience with PHPUnit so expect my mistake is a basic one.我对 PHPUnit 没有什么经验,所以希望我的错误是一个基本错误。

Thanks for any advice you can give, Dan感谢您提供的任何建议,丹

Check that you include PHPUnit when you call tests.. either in php.ini, or with IDE that you run, or explicitly - right now it just can't find class.. which means that PHPUnit is not reachable.检查您在调用测试时是否包含 PHPUnit.. 在 php.ini 中,或者在您运行的 IDE 中,或者明确地 - 现在它只是找不到 class.. 这意味着 PHPUnit 无法访问。 Try a simplier class, PHPUnit_Extensions_SeleniumTestCase试试更简单的 class,PHPUnit_Extensions_SeleniumTestCase

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM