aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/unit/includes/dao
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2023-07-13 22:00:47 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2023-07-18 16:35:43 +0000
commit0099099bb0e9588f6fa2489350eb02f76bb6bee8 (patch)
treeb592fc2c71c57b1d9576695b1e05c23eebd4265f /tests/phpunit/unit/includes/dao
parentbffa95de81d5dbf7d6e6504d6338f8dbe2d036b7 (diff)
downloadmediawikicore-0099099bb0e9588f6fa2489350eb02f76bb6bee8.tar.gz
mediawikicore-0099099bb0e9588f6fa2489350eb02f76bb6bee8.zip
tests: Change expectDeprecation to expectDeprecationAndContinue
TestCase::expectDeprecation() is deprecated in PHPUnit 10, use mediawiki own MediaWikiTestCaseTrait::expectDeprecationAndContinue() for this case. This avoids the trigger_error call and isolate the deprecation check into MWDebug class. The continue part is also helpful in StubGlobalUserTest, where after the first deprecation access more code exists, that was not executed as PhpUnit 9 converts deprecations to exceptions. In RCFeedTest the exception needs to be catched as the code proceed after the deprecation notice is emitted. Bug: T342110 Change-Id: Iecf827bec0d5215fd21bbb20b84caf928ee108a0
Diffstat (limited to 'tests/phpunit/unit/includes/dao')
-rw-r--r--tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php b/tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php
index 4a4606e223d9..0ab69dfa15c2 100644
--- a/tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php
+++ b/tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php
@@ -95,7 +95,7 @@ class WikiAwareEntityTraitTest extends MediaWikiUnitTestCase {
* @dataProvider provideMismatchingWikis
*/
public function testDeprecateInvalidCrossWikiMismatch( $entityWiki, $assertWiki ) {
- $this->expectDeprecation();
+ $this->expectDeprecationAndContinue( '/Deprecated cross-wiki access/' );
TestingAccessWrapper::newFromObject( $this->getEntityInstance( $entityWiki ) )
->deprecateInvalidCrossWiki( $assertWiki, '1.99' );
}