PhpUnit 9 fails with php 8+ - php

I tried using PHPUnit 9 but it is not supporting the latest version of PHP above 8.0
I am receiving this following error
Fatal error: Uncaught Error: Call to undefined function each() in C:\xampp\php\pear\PHPUnit\Util\Getopt.php:80 Stack trace: #0 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(242): PHPUnit_Util_Getopt::getopt(Array, 'd:c:hv', Array) #1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(138): PHPUnit_TextUI_Command->handleArguments(Array) #2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true) #3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main() #4 {main} thrown in C:\xampp\php\pear\PHPUnit\Util\Getopt.php on line 80

Related

Uncaught Error: Class "Test\TestCase" not found running test with PHPStorm

I'm using PHPUNIT 9.5 and I'm running tests with PHPStorm like I show in the following image
The test that I want to run is:
<?php
namespace test\ccs\repository;
 
use test\UnitTestCase;
 
class SignInRepositoryTest extends UnitTestCase
 {
...
...
}
Composer.json has:
"autoload": {
"classmap": [
"app/controllers",
"app/models",
"app/views"
],
"psr-4": {
"ccs\\": "library/ccs/",
"test\\": "tests/test/"
}
},
When I run the test I got the error:
PHP Fatal error: Uncaught Error: Class "test\UnitTestCase" not found
in
C:\inetpub\PublicPortal\application\ccsignin\tests\test\ccs\repository\SignInRepositoryTest.php:4
Stack trace:
#0 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\Util\FileLoader.php(66):
include_once()
#1 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\Util\FileLoader.php(49):
PHPUnit\Util\FileLoader::load()
#2 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\Framework\TestSuite.php(397):
PHPUnit\Util\FileLoader::checkAndLoad()
#3 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\Framework\TestSuite.php(527):
PHPUnit\Framework\TestSuite->addTestFile()
#4 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\Runner\BaseTestRunner.php(98):
PHPUnit\Framework\TestSuite->addTestFiles()
#5 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\TextUI\Command.php(121):
PHPUnit\Runner\BaseTestRunner->getTest()
#6 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\TextUI\Command.php(97):
PHPUnit\TextUI\Command->run()
#7 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\phpunit(98): PHPUnit\TextUI\Command::main()
#8 {main}
Next PHPUnit\TextUI\RuntimeException: Class "test\UnitTestCase" not
found in
C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\TextUI\Command.php:99
Stack trace:
#0 C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\phpunit(98): PHPUnit\TextUI\Command::main()
#1 {main} thrown in C:\inetpub\PublicPortal\vendors\PHPUnit\phpunit\src\TextUI\Command.php
on line 99

Upgrade xmlRpc version form 1.1 to 4.8

yesterday upgraded php from 5.5 to 8.1, it gave me this error:
Fatal error: Uncaught TypeError: xml_parse(): Argument #1 ($parser) must be of type XMLParser, null given in /var/www/html/app/library/xmlrpc/xmlRpcClient.php:90 Stack trace: #0 /var/www/html/app/library/xmlrpc/xmlRpcClient.php(90): xml_parse() #1 /var/www/html/app/library/xmlrpc/xmlRpcClient.php(151): XML->parse() #2 /var/www/html/app/library/xmlrpc/xmlRpcClient.php(397): XML_unserialize() #3 /var/www/html/app/controller.php(271): XMLRPC_request() #4 /var/www/html/app/style/aura/index.php(450): include('...') #5 /var/www/html/app/index.html.php(25): include_once('...') #6 /var/www/html/app/index.php(177): require_once('...') #7 {main} thrown in /var/www/html/app/library/xmlrpc/xmlRpcClient.php on line 90
I've fixed some code, but i'm afraid need to update library. How can do it from command line or anyhow quickly?

Why is there an error like this when I install inoerp?

I am trying to install inoerp and am getting the following error:
Fatal error: Uncaught Error: Call to undefined function create_function() in C:\xampp\htdocs\inoerp\www\includes\engine\install\steps\complete_install.php:78
Stack trace:
#0 C:\xampp\htdocs\inoerp\www\includes\engine\install\steps\complete_install.php(20): getQueriesFromSQLFile('C:\\xampp\\htdocs...')
#1 C:\xampp\htdocs\inoerp\www\includes\engine\install\steps\complete_install.php(115): importSQL('C:\\xampp\\htdocs...', Object(dbc))
#2 C:\xampp\htdocs\inoerp\www\includes\engine\install\install_template.php(40): require_once('C:\\xampp\\htdocs...')
#3 C:\xampp\htdocs\inoerp\www\install.php(44): include_once('C:\\xampp\\htdocs...')
#4 {main} thrown in C:\xampp\htdocs\inoerp\www\includes\engine\install\steps\complete_install.php on line 78

Fatal error: Uncaught Error: Class 'Elementor\Controls_Manager' not found

I'm having this error in my wordpress website.
Fatal error: Uncaught Error: Class 'Elementor\Controls_Manager' not found in /home/vol15_6/epizy.com/epiz_26758330/htdocs/wp-content/plugins/elementor/includes/autoloader.php:132 Stack trace: #0 /home/vol15_6/epizy.com/epiz_26758330/htdocs/wp-content/plugins/elementor/includes/autoloader.php(78): Elementor\Autoloader::init_classes_map() #1 /home/vol15_6/epizy.com/epiz_26758330/htdocs/wp-content/plugins/elementor/includes/autoloader.php(252): Elementor\Autoloader::get_classes_map() #2 /home/vol15_6/epizy.com/epiz_26758330/htdocs/wp-content/plugins/elementor/includes/autoloader.php(305): Elementor\Autoloader::load_class('Core\\Logger\\Man...') #3 [internal function]: Elementor\Autoloader::autoload('Elementor\\Core\\...') #4 /home/vol15_6/epizy.com/epiz_26758330/htdocs/wp-content/plugins/elementor/includes/plugin.php(708): spl_autoload_call('Elementor\\Core\\...') #5 /home/vol15_6/epizy.com/epiz_26758330/htdocs/wp-content/plugins/elementor/includes/plugin.php(487): Elementor\Plugin->__construct() #6 /home/vol15_6/epizy.com/e in /home/vol15_6/epizy.com/epiz_26758330/htdocs/wp-content/plugins/elementor/includes/autoloader.php on line 132
The solution was to downgrade elementor to an older version of 3.0.11.

Phalcon Unittest Not Working

PHP Fatal error: Uncaught Error: Call to undefined method
PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in /vagrant/cmol-rule-engine-v2.0/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:1066
Stack trace:
#0 /vagrant/cmol-rule-engine-v2.0/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(163): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 /usr/share/php/PHPUnit/TextUI/Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 /usr/share/php/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 /usr/bin/phpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in /vagrant/cmol-rule-engine-v2.0/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 1066

Categories