Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

338
Visualizações
PHPUnit deprecation warning fails test

I'm using PHPUnit 4.8 on a PHP 5.3.29 install. Some of the code in our application makes use of the deprecated mysql_* functionality, and PHPUnit converts the deprecation notices of these instances to exceptions and in turn fails those specific testcases.

Now I've already included the convertErrorsToExceptions="false" in the config.xml but this doesn't seem to help as it's still happening.

Can anyone help shed some light on what might be happening here?

Cheers!

EDIT: Added example files on gist.github.com

about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

if you are looking solution for Symfony 3.1 and higher versions, the answer is

<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" />
about 4 years ago · Santiago Trujillo Relatório

0

The convertErrorsToExceptions="false" configuration option only controls the conversion of E_ERROR to exceptions. A deprecation is represented as E_DEPRECATED, though.

A configuration option is missing for controlling the conversion of E_DEPRECATED to exceptions. This will be added in PHPUnit 6.2. This will not be backported to PHPUnit 4.8, the version of PHPUnit you are using, as that version has reached its end of life.

In your bootstrap script you can set PHPUnit_Framework_Error_Deprecated::$enabled = false;, though, which will disable the conversion of E_DEPRECATED to exceptions.

about 4 years ago · Santiago Trujillo Relatório

0

If anyone is looking for a Symfony/Drupal related solution, a quick way can be to set the env variable in your test file(I needed it because deprecation warnings were coming from a third party repo).

putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda