diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2017-04-05 16:39:50 -0700 |
---|---|---|
committer | Krinkle <krinklemail@gmail.com> | 2017-04-06 00:44:32 +0000 |
commit | 447ce7e39ab22806cbdea1244d77480c5753dad2 (patch) | |
tree | 18ff4eb1598f99ee4650f3a950c53dd499a213bb /tests/phpunit/includes/content/WikitextContentHandlerTest.php | |
parent | 8e70e7f14a6d9ccad363580915d69e786da17093 (diff) | |
download | mediawikicore-447ce7e39ab22806cbdea1244d77480c5753dad2.tar.gz mediawikicore-447ce7e39ab22806cbdea1244d77480c5753dad2.zip |
phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat
The default will remain PHPUnit 4.x due to PHP 5.5 support.
But, we should allow developers to run tests with newer PHPUnit
versions which are noticably faster (especially for code coverage
reports).
* <https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.4.0>
PHPUnit 5 deprecates the getMock() shortcut for getMockBuilder()->getMock().
It instead introduces the shortcut createMock() which has better defaults
than getMockBuilder(). For example, it sets 'disableArgumentCloning' and
other things by default.
Going forward, code should either use getMockBuilder directly and configure
it using the setter methods (instead of the confusing variadic arguments
of getMock) or simply use the new minimalistic createMock method. This patch
backports the createMock method to MediaWikiTestCase so that we can start
using it.
Change-Id: I091c0289b21d2b1c876adba89529dc3e72b99af2
Diffstat (limited to 'tests/phpunit/includes/content/WikitextContentHandlerTest.php')
-rw-r--r-- | tests/phpunit/includes/content/WikitextContentHandlerTest.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php index ec97d763710d..290b11ab0071 100644 --- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php +++ b/tests/phpunit/includes/content/WikitextContentHandlerTest.php @@ -245,7 +245,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase { */ public function testDataIndexFieldsFile() { - $mockEngine = $this->getMock( 'SearchEngine' ); + $mockEngine = $this->createMock( 'SearchEngine' ); $title = Title::newFromText( 'Somefile.jpg', NS_FILE ); $page = new WikiPage( $title ); |