php artisan test fails immediately
P粉779565855
2023-08-10 16:48:28
<p>The command php artisan test fails immediately with the error<b>Typed property DOMDocument::$documentElement</b>must be inaccessible before initialization</p>
<p>I made no changes to the default test cases, and I ran the command from the root of the project. </p>
<p>I am currently using an Ubuntu system with php 8.1 installed. </p>
This probably means you have the XDEBUG extension installed for your version of PHP CLI. For PHP8.1, to disable this XDEBUG extension, you can run the following command in the terminal:
sudo apt-get purge php8.1-xdebug && phpdismod xdebug
If this does not resolve the issue, you may need to restart the PHP service and ensure that the PHP CLI is also using version PHP 8.1. If not, modify the above command to suit your PHP version