aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/mocks/MockTitleTrait.php
diff options
context:
space:
mode:
authorDaimona Eaytoy <daimona.wiki@gmail.com>2021-03-23 12:30:33 +0100
committerDaimona Eaytoy <daimona.wiki@gmail.com>2021-03-23 12:59:34 +0000
commit4877132223e0fb0cb6548f7290410e6ecd76c421 (patch)
treebeb04a440147c8c4d46cfe267b9cde099953d430 /tests/phpunit/mocks/MockTitleTrait.php
parent00121500724755569ba61bd88f9aa9a3e78d75b2 (diff)
downloadmediawikicore-4877132223e0fb0cb6548f7290410e6ecd76c421.tar.gz
mediawikicore-4877132223e0fb0cb6548f7290410e6ecd76c421.zip
phpunit: Don't redefine methods in traits
The signatures of these methods will change in PHPUnit 9, and in general, having these methods means additional code to maintain. Since this is test code, any attempt to use these traits from a class which doesn't have the required methods will fail hard, and as such, there's no reason to have these methods at all. Also, MockServiceDependenciesTrait was redeclaring fail() as a non-static method, but it is actually static in the parent class, which makes tests fail on PHP 8. Bug: T243600 Change-Id: I78bf1bdd2eb2e09aed27d1b6bff2302e28600703
Diffstat (limited to 'tests/phpunit/mocks/MockTitleTrait.php')
-rw-r--r--tests/phpunit/mocks/MockTitleTrait.php19
1 files changed, 0 insertions, 19 deletions
diff --git a/tests/phpunit/mocks/MockTitleTrait.php b/tests/phpunit/mocks/MockTitleTrait.php
index 1012c95e0853..233933b2905a 100644
--- a/tests/phpunit/mocks/MockTitleTrait.php
+++ b/tests/phpunit/mocks/MockTitleTrait.php
@@ -101,23 +101,4 @@ trait MockTitleTrait {
return $titleCodec;
}
-
- /**
- * Expected to be provided by the class, probably inherited from TestCase.
- *
- * @param string $originalClassName
- *
- * @return MockObject
- */
- abstract protected function createMock( $originalClassName ): MockObject;
-
- /**
- * Expected to be provided by the class, probably MediaWikiTestCaseTrait.
- *
- * @param string $type
- * @param string[] $allow methods to allow
- *
- * @return MockObject
- */
- abstract protected function createNoOpMock( $type, $allow = [] );
}