[英]PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found
My Current PHP version: 7.1.28我当前的 PHP 版本:7.1.28
My PHPUnit 7.5.9 by Sebastian Bergmann and contributors.我的 PHPUnit 7.5.9 由 Sebastian Bergmann 和贡献者编写。
PHPUnit installed with PHP Archive (PHAR)随 PHP 存档 (PHAR) 一起安装的 PHPUnit
➜ wget -O phpunit https://phar.phpunit.de/phpunit-7.phar ➜ wget -O phpunit https://phar.phpunit.de/phpunit-7.phar
➜ chmod +x phpunit ➜ chmod +x phpunit
➜ ./phpunit --version ➜ ./phpunit --version
but after installing PHPUnit with PHAR it isn't generate "src/autoload.php" but just only file phpunit但是在使用 PHAR 安装 PHPUnit 后,它不会生成“src/autoload.php”,而只是生成文件 phpunit
but if I run ./phpunit --version in terminal it's show PHPUnit 7.5.9 by Sebastian Bergmann and contributors.但是如果我在终端运行 ./phpunit --version ,它会显示 Sebastian Bergmann 和贡献者的 PHPUnit 7.5.9。
I download the zip in https://github.com/bigmlcom/bigml-php and extract it then I run it bigml-php-master/tests/test_00_regressions.php then I got an error message PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found我在https://github.com/bigmlcom/bigml-php下载 zip 并解压缩,然后运行 bigml-php-master/tests/test_00_regressions.php 然后我收到一条错误消息 PHP Fatal error: Class 'PHPUnit_Framework_TestCase'未找到
can anybody help me please有人可以帮我吗
Apparently bigml-php's README doesn't specify which version of phpunit should be used, though it's probably 5.x while the test class extends old class name PHPUnit_Framework_TestCase
.显然bigml-php 的 README没有指定应该使用哪个版本的 phpunit,尽管它可能是 5.x,而测试类扩展了旧的类名
PHPUnit_Framework_TestCase
。
You can still download phpunit-5.7.27.phar .您仍然可以下载phpunit-5.7.27.phar 。 And it seems it's working:
它似乎正在工作:
./phpunit-5.7.27.phar test_00_regressions.php
Latest method:最新方法:
use PHPUnit\Framework\TestCase;
class SampleTest extends TestCase
{
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.