Topic on Project:Support desk

Is there a way to suppress Deprecated messages using PHPunit?

6
185.69.144.181 (talkcontribs)

I am running the following:


sudo -u www-data env "PHP_IDE_CONFIG=serverName=mwvagrant" "CIRRUS_REBUILD_FIXTURES=yes" "XDEBUG_CONFIG=idekey=netbeans-xdebug" php tests/phpunit/phpunit.php --wiki=wiki --stop-on-failure --stop-on-error extensions/MyExtension/tests/phpunit/


As indicated in the MediaWiki vagrant documentation and I keep getting Deprecated Notices. Is there a way to silence those Deprecated notices?


Thank you

Bawolff (talkcontribs)

I think its intentional that a deprecation warning breaks tests.

185.69.145.77 (talkcontribs)

Bawolff, thank you very much for your response.

The test actually succeed. Its just that I get about 10 deprecation + all the stack traces which means I need to scroll a lot to see whats a warning and whats a deprecation and to find whether it succeeds and what are the errors, etc. its very impractical.

Ammarpad (talkcontribs)

You can set $wgDeprecationReleaseLimit = '1.x'; to suppress all deprecation warnings added in version > '1.x'.

185.69.145.77 (talkcontribs)

That is exactly it. Thank you Ammarpad!

Jmr1985 (talkcontribs)

I had this same problem, with HighlightUS but one message would not disappear!


Adding 'error_reporting(0);'above the last error message line suppressed this as well

Reply to "Is there a way to suppress Deprecated messages using PHPunit?"