Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

2.1K
Views
PHPUnit no puede adquirir la referencia a $ GLOBALS

Recibo un error cuando ejecuto pruebas de PHPUnit en acciones de GitHub.

 PHP Fatal error: Cannot acquire reference to $GLOBALS in /home/runner/work/project-name/project-name/vendor/phpunit/phpunit/src/Util/Configuration.php on line 570

Parece que este error probablemente esté relacionado con PHP8 ( https://php.watch/versions/8.1/GLOBALS-restrictions ), pero la matriz de prueba solo debería ejecutar PHP 7.2 y 7.4 (las pruebas funcionan bien localmente en PHP 7.4).

Error que se muestra aquí en GitHub Actions . La matriz de prueba está aquí .

Cualquier ayuda muy apreciada!

--

Editar:

Se resolvió esto configurando específicamente la versión de PHP en el contenedor como primer paso:

 # PHPUnit errors with latest PHP 8.X build. # This specifically sets PHP version to 7.4. - name: Setup PHP with tools uses: shivammathur/setup-php@v2 with: php-version: '7.4' tools: phpunit
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Está utilizando PHPUnit 7.5.20 que no es compatible con PHP 8.

over 4 years ago · Santiago Trujillo Report

0

Tuve el mismo error al ejecutar un trabajo de CI en PHP 8.1 con la instalación de Composer en --prefer-lowest con phpunit versión 8.5.12

Reforzar la dependencia de phpunit/phpunit de >=8.5 a >=8.5.23 resolvió este problema.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!