Actions
Bug #67092
closedEpic #65314: PHP7
PHP7 Warning DateViewHelperTest::setLocale() should be compatible with PHPUnit_Framework_TestCase::setLocale()
Start date:
2015-05-21
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
PHP Warning: Declaration of TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Format\DateViewHelperTest::setLocale() should be compatible with PHPUnit_Framework_TestCase::setLocale() in /home/travis/build/TYPO3/TYPO3.CMS/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php on line 264
This happens because PHP7 reads the type hint in PHPUnit_Framework_TestCase:
/** * This method is a wrapper for the setlocale() function that automatically * resets the locale to its original value after the test is run. * * @param integer $category * @param string $locale * @throws PHPUnit_Framework_Exception * @since Method available since Release 3.1.0 */ protected function setLocale() {
while DateViewHelperTest has its own definition for setLocale which is not compatible
/** * @param string $locale */ protected function setLocale($locale) { setlocale(LC_CTYPE, $locale); setlocale(LC_MONETARY, $locale); setlocale(LC_TIME, $locale); }
first param int vs string.
How to deal with that? Rename the function in DateViewHelperTest ? Edit phpunit on github to remove the type hinting?
Actions