__VSCODE_LARAVEL_START_OUTPUT__ class@anonymous::loadConfig(): Return value must be of type ?PHPUnit\TextUI\XmlConfiguration\LoadedFromFileConfiguration, PHPUnit\TextUI\XmlConfiguration\Configuration returned (500 Internal Server Error)

Symfony Exception

TypeError

HTTP 500 Internal Server Error

class@anonymous::loadConfig(): Return value must be of type ?PHPUnit\TextUI\XmlConfiguration\LoadedFromFileConfiguration, PHPUnit\TextUI\XmlConfiguration\Configuration returned

Exception

TypeError

  1.         foreach ([
  2.             base_path('phpunit.xml'),
  3.             base_path('phpunit.xml.dist'),
  4.         ] as $path) {
  5.             if (File::exists($path)) {
  6.                 return (new XmlConfigurationLoader)->load($path);
  7.             }
  8.         }
  9.         return null;
  10.     }
  1.     /**
  2.      * @return array<int, array{name: string, directories: array<int, string>, files: array<int, string>}>
  3.      */
  4.     protected function getTestSuites(): array
  5.     {
  6.         if (is_null($config = $this->loadConfig())) {
  7.             return [[
  8.                 'name' => 'default',
  9.                 'directories' => [base_path('tests')],
  10.                 'files' => $this->findTestFiles(base_path('tests')),
  11.             ]];
  1.         if ($this->isPestInstalled()) {
  2.             $this->bootPest();
  3.         }
  4.         return collect(
  5.             $this->getTestSuites()
  6.         )->map(fn ($suite) => [
  7.             'name' => $suite['name'],
  8.             'files' => collect(array_merge(
  9.                 $this->collectPhpUnitTests($suite['files']),
  10.                 $this->collectPestTests($suite['files']),
  1.         return str_starts_with($method->getName(), 'test')
  2.             || $method->getAttributes(Test::class) !== [];
  3.     }
  4. };
  5. echo json_encode($tests->all());
  6. echo LaravelVsCode::outputMarker('END_OUTPUT');
  7. exit(0);

Stack Trace

TypeError
TypeError:
class@anonymous::loadConfig(): Return value must be of type ?PHPUnit\TextUI\XmlConfiguration\LoadedFromFileConfiguration, PHPUnit\TextUI\XmlConfiguration\Configuration returned

  at /home/ldxcpnl/public_html/vendor/_laravel_ide/discover-4dd8aa2c89a79640c26a5af93ae899b1.php:182
  at class@anonymous/home/ldxcpnl/public_html/vendor/_laravel_ide/discover-4dd8aa2c89a79640c26a5af93ae899b1.php:79$1->loadConfig()
     (/home/ldxcpnl/public_html/vendor/_laravel_ide/discover-4dd8aa2c89a79640c26a5af93ae899b1.php:144)
  at class@anonymous/home/ldxcpnl/public_html/vendor/_laravel_ide/discover-4dd8aa2c89a79640c26a5af93ae899b1.php:79$1->getTestSuites()
     (/home/ldxcpnl/public_html/vendor/_laravel_ide/discover-4dd8aa2c89a79640c26a5af93ae899b1.php:91)
  at class@anonymous/home/ldxcpnl/public_html/vendor/_laravel_ide/discover-4dd8aa2c89a79640c26a5af93ae899b1.php:79$1->all()
     (/home/ldxcpnl/public_html/vendor/_laravel_ide/discover-4dd8aa2c89a79640c26a5af93ae899b1.php:310)