[dokuwiki] New PR: Fix test failing due to wrong function signature in PHPUnit

  • From: "phy25" <wiki@xxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 3 Mar 2018 18:34:35 +0100 (CET)

Hi,

phy25 opened a new pull request at 
https://github.com/splitbrain/dokuwiki/pull/2266:

Since https://travis-ci.org/splitbrain/dokuwiki/jobs/341425911 the tests on PHP ;
7.2 have failed because of the following error. I don't understand why this 
happened as we stick PHPUnit to 5.7 and there is no return type hinting in its 
source code.

Fatal error: Declaration of DokuWikiTest::createMock($originalClassName) must 
be compatible with 
PHPUnit\Framework\TestCase::createMock($originalClassName): 
PHPUnit\Framework\MockObject\MockObject in 
/home/travis/build/splitbrain/dokuwiki/_test/core/DokuWikiTest.php on line 27

This is a patch to let the test passing by moving the old `createMock` polyfill 
to a new class `PHPUnit_Framework_TestCase_Compat`, which would not execute in 
the new PHPUnit version with return type hinting.

Out of this patch, we have another option of removing the polyfill and [drop 
support below PHPUnit 
5.4](https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.4.0#new-features),
 which simplifies things.

Please help us to review this pull request, so new contributors get feedback in 
a timely manner.

23c3a070-1f09-11e8-8c9d-6fd89b800a5e


-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts:

  • » [dokuwiki] New PR: Fix test failing due to wrong function signature in PHPUnit - phy25