EverKB

Knowledge Base Ever

Vyřešte problém Fatal error: Class 'PHPUnit_Framework_TestCase' not found

2020-01-07 11:41:06

Štítek: PHPUnit,PHPUnit Framework,TestCase,

U verze PHPUnit verze 6 nebo vyšší refaktor k oboru názvů.

Při upgradu PHPUnit na verzi 6 nebo vyšší 2017-02-03, například při použití skladatele, se setkáte s výše uvedenou závažnou chybou: Fatal error: Class 'PHPUnit_Framework_TestCase' not found, protože jeho kód nyní používá jmenné prostory. Takže musíte
\PHPUnit_Framework_TestCase\PHPUnit\Framework\TestCase
// backward compatibility
if (!class_exists('\PHPUnit\Framework\TestCase') &&
    class_exists('\PHPUnit_Framework_TestCase')) {
    class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
}

Štítek

CentOS7 CentOS PHP Linux Python Python3 MySQL MariaDB YUM JavaScript HTML mysql_native_password PHP7 CSS Redis MySQL8 caching_sha2_password ss5-3.8.9 Apache2.4 Elasticsearch libpython3.7m.so.1.0 PHPStorm show VIM CURLOPT_POSTFIELDS NodeJs substr Bluetooth Failed to build these modules: _ctypes Minimal ISO SQL Date Funcitons Wi-Fi date sub INTERVAL PECL Tag Cloud CodeIgniter font-size root ss5 apache httpd dual network interfaces Laravel ShadowsocksR vertical-align CURLFille horiz-align node.js SUBDATE BarManager exec mb_substr PyCharm SOCKS5 Proxy Server WebStorm date add IntelliJIDEA PEAR Tag Chrome find remi src Apache du jQuery PHP5.5 V2Ray cURL hide nginx Shadowsocks-Python sub folder availability eth0 MariaDB10.4 PostgreSQL SOCKS5 Web Server date Install MongoDB pdo_sqlsrv Symfony File Upload mssql-tools register_shutdown_function sqlsrv Zend Framework ADDDATE DevExpress JetBrain php-fpm unixODBC-devel height network interface Shadowsocks-Libev string Aura error_get_last Port 80 SOCKS Web Development data INDENTIFIED BY password policy requirements SVN Fedora Media Writer msodbcsql Redis5 SQLAlchemy absolute Deepin jemalloc toggle convert FuelPHP mysqlclient Shadowsocks ss5.passwd at-symbol Error Control Operator margin PHPUnit Framework SOCKET vps daemon process IIS password sudoers center Fatal Errors MongoDB4 SQL Server 2017 WiFi .htaccess DATE_SUB Phalcon TestCase Compiling PHP frequency conflict set_error_handler ss5.conf apr Elasticsearch7.3 PHPUnit Slim Vincent Garreau daemon HTTP particles.js Sudo Failed to build these modules: _uuid MongoDB SQL Server width DATE_ADD ip command pg_bha.conf Tcp BBR Compiling Apache Frameworks MySQL-python scrollbar