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

284
Views
¿Qué podría causar que PHPUnit no imprima mensajes de error muy grandes?

Esto parece suceder sólo en mi sistema. Nadie más podría reproducirlo. Si el mensaje de error es demasiado grande (alrededor de 65k bytes en mi caso) no se imprime nada en la pantalla. Estoy usando PHP 7.1.3 en Windows 7, con el php.ini predeterminado (límite de memoria establecido en 8 gb) y la configuración predeterminada de PHPUnit 6.0.13. El error no aparece ni en el indicador ni en PowerShell.

 <?php use PHPUnit\Framework\Constraint\Constraint; use PHPUnit\Framework\TestCase; class MyConstraint extends Constraint { protected $expected; function __construct($expected){ parent::__construct(); $this->expected = $expected; } protected function matches($actual){ return false; } function failureDescription($other): string{ return "desc"; } function toString(){ return "description"; } function additionalFailureDescription($other): string{ return str_repeat("x", 100000); // If set to a smaller dump, error will appear // some people I asked to try could dump one million // bytes without problems, while I can't print more // than about 50k } } class SomeTest extends TestCase { function testBigDump(){ TestCase::assertThat("irrelevant", new MyConstraint("irrelevant")); } } ?>

Y esto es lo que me sale en pantalla:

PHPUnit 6.0.13 por Sebastian Bergmann y colaboradores.

Tiempo de ejecución: PHPDBG 7.1.3 Configuración: ..............

F 1 / 1 (100%)

Tiempo: 361 ms, Memoria: 6,00 MB

Hubo 1 falla:

1) SomeTest::testBigDump

 <------- Notice no error description here

¡FRACASOS! Pruebas: 1, Aserciones: 1, Fallos: 1.

¿Tienes alguna idea de qué podría causar esto? Gracias de antemano.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Algo en su configuración está ejecutando la prueba de phpunit a través de phpdbg

Recreé este problema, intentando replicar el entorno tanto como sea posible usando una máquina virtual con Windows 7.

La pista fue la línea Runtime: PHPDBG en su volcado. Aparentemente, algo en el tiempo de ejecución de phpdbg impide que los búfer grandes funcionen correctamente. Vea mi resultado a continuación, tanto el resultado inicial cuando se ejecuta a través de phpdbg.exe (falta la descripción de la prueba) y luego cuando se ejecuta a través de php.exe (truncado, obviamente):

 C:\project>phpdbg -r phpunit-6.1.0.phar -v test.php [Welcome to phpdbg, the interactive PHP debugger, v0.5.0] To get help using phpdbg type "help" and press enter [Please report bugs to <http://bugs.php.net/report.php>] PHPUnit 6.1.0 by Sebastian Bergmann and contributors. Runtime: PHPDBG 7.1.4 F 1 / 1 (100%) Time: 99 ms, Memory: 22.00MB There was 1 failure: 1) SomeTest::testBigDump FAILURES! Tests: 1, Assertions: 1, Failures: 1. [Script ended normally] C:\project>php phpunit-6.1.0.phar test.php PHPUnit 6.1.0 by Sebastian Bergmann and contributors. F 1 / 1 (100%) Time: 109 ms, Memory: 8.00MB There was 1 failure: 1) SomeTest::testBigDump Failed asserting that desc. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ----- Snip -----
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!