gpt4 book ai didi

Selenium/Ubuntu 的 PHPUnit fatal error

转载 作者:行者123 更新时间:2023-12-04 18:53:57 27 4
gpt4 key购买 nike

我已经阅读了各种教程/帖子,在我的 Ubuntu 系统上安装了带有 Selenium 的 PHPUnit。我相信我已按要求进行了所有设置:

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

因此,我使用 IDE 创建了我的测试,并将其保存以供运行,这似乎是根据需要进行设置的。所以我使用以下方法运行测试:
phpunit /home/retrobadger/working_files/tutorials/phpunit/selenium1.php

但每次我运行它时,我都会收到以下错误:
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

扩展名中的文件存在,我已经为它设置了非常开放的权限。我能想到的唯一事情是我的 SeleniumTestCase.php 有问题,或者我需要另一个没有其他教程建议的文件。

任何建议将不胜感激。我对 PHPUnit 的经验很少,所以希望我的错误是一个基本错误。

感谢您提供的任何建议,

最佳答案

检查您在调用测试时是否包含 PHPUnit。无论是在 php.ini 中,还是在您运行的 IDE 中,或者显式地——现在它只是找不到类。这意味着 PHPUnit 无法访问。尝试一个更简单的类 PHPUnit_Extensions_SeleniumTestCase

关于Selenium/Ubuntu 的 PHPUnit fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10071642/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com