aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/ApiOptionsTest.php
diff options
context:
space:
mode:
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>2022-07-14 14:42:07 +0200
committerThiemo Kreuz (WMDE) <thiemo.kreuz@wikimedia.de>2022-07-15 16:43:48 +0000
commit61ae7504df75130c18b35b5e7f48ac6874c2606b (patch)
tree0ecba743bfd432dc24b7401511c6952c3480636b /tests/phpunit/includes/api/ApiOptionsTest.php
parent37764c80cc173df0b0bb92fc7f33d6c2161cdb59 (diff)
downloadmediawikicore-61ae7504df75130c18b35b5e7f48ac6874c2606b.tar.gz
mediawikicore-61ae7504df75130c18b35b5e7f48ac6874c2606b.zip
Replace trivial usa of mock builder with createMock() shortcut
createMock() does the same, but is much easier to read. A small difference is that some of the replacements made in this patch didn't use disableOriginalConstructor() before. In case this was relevant we should see the respective test fail. If not we can save some CPU cycles and skip these constructors. Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
Diffstat (limited to 'tests/phpunit/includes/api/ApiOptionsTest.php')
-rw-r--r--tests/phpunit/includes/api/ApiOptionsTest.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/phpunit/includes/api/ApiOptionsTest.php b/tests/phpunit/includes/api/ApiOptionsTest.php
index c505f29e2164..bdeb00ff8f00 100644
--- a/tests/phpunit/includes/api/ApiOptionsTest.php
+++ b/tests/phpunit/includes/api/ApiOptionsTest.php
@@ -30,9 +30,7 @@ class ApiOptionsTest extends MediaWikiLangTestCase {
protected function setUp(): void {
parent::setUp();
- $this->mUserMock = $this->getMockBuilder( User::class )
- ->disableOriginalConstructor()
- ->getMock();
+ $this->mUserMock = $this->createMock( User::class );
// No actual DB data
$this->mUserMock->method( 'getInstanceForUpdate' )->willReturn( $this->mUserMock );