Configure PHPunit to convert deprecation errors to exceptions, but ignore them in tests by default.

This commit is contained in:
Simon Wisselink
2024-03-18 11:45:07 +01:00
parent 7d40a092ac
commit 2e03a1caff
2 changed files with 6 additions and 2 deletions

View File

@@ -15,7 +15,11 @@
timeoutForSmallTests="1" timeoutForSmallTests="1"
timeoutForMediumTests="10" timeoutForMediumTests="10"
timeoutForLargeTests="60" timeoutForLargeTests="60"
verbose="false"> verbose="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true">
<testsuites> <testsuites>
<testsuite name="foo"> <testsuite name="foo">
<directory>./tests/UnitTests/</directory> <directory>./tests/UnitTests/</directory>

View File

@@ -149,7 +149,7 @@ class PHPUnit_Smarty extends PHPUnit\Framework\TestCase
$this->smarty->setCacheDir(__DIR__ . '/cache'); $this->smarty->setCacheDir(__DIR__ . '/cache');
} }
$this->getSmartyObj(); $this->smarty->setErrorReporting(E_ALL &~ E_USER_DEPRECATED);
} }
/** /**