简体   繁体   English

PHP 致命错误:找不到类“PHPUnit_Framework_TestCase”

[英]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.

相关问题 Symfony:致命错误:找不到类'PHPUnit_Framework_TestCase' - Symfony: Fatal error: Class 'PHPUnit_Framework_TestCase' not found in PHPUnit CodeIgniter生成夹具PHP致命错误:未找到类“ PHPUnit_Framework_TestCase” - PHPUnit CodeIgniter Generate Fixtures PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found 致命错误:找不到类'PHPUnit_Framework_TestCase' - Fatal error: Class 'PHPUnit_Framework_TestCase' not found 为什么,致命错误:在...中找不到类“PHPUnit_Framework_TestCase”? - Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...? 致命错误:在第24行的dbunit \\ PHPUnit \\ Extensions \\ Database \\ TestCase.php中找不到类“ PHPUnit_Framework_TestCase” - Fatal error: Class 'PHPUnit_Framework_TestCase' not found in dbunit\PHPUnit\Extensions\Database\TestCase.php on line 24 PHP 单元 - 找不到类“PHPUnit_Framework_TestCase” - PHP unit - Class 'PHPUnit_Framework_TestCase' not found PHPUnit类“错误”不会扩展PHPUnit_Framework_TestCase - PHPUnit Class “Error” does not extend PHPUnit_Framework_TestCase 在Symfony2项目中找不到类'PHPUnit_Framework_TestCase' - Class 'PHPUnit_Framework_TestCase' not found in Symfony2 project 如何处理“ PHPUnit_Framework_TestCase”类未找到错误? - How do I deal with Class 'PHPUnit_Framework_TestCase' not found error? PHP 致命错误:在 PHPUnit 6 和 PHP 7.0 中找不到“PHPUnit\\Framework\\TestCase”类 - PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found with PHPUnit 6 and PHP 7.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM