Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F585108
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/RELEASE-NOTES-1.44 b/RELEASE-NOTES-1.44
index 69364b53ffa..8390ba6cb11 100644
--- a/RELEASE-NOTES-1.44
+++ b/RELEASE-NOTES-1.44
@@ -647,6 +647,8 @@ because of Phabricator reports.
are now deprecated. Use UploadBase::authorizeUpload() instead.
* PermissionStatus::toLegacyErrorArray(), deprecated since 1.43, is now
emitting warnings.
+* MediaWikiIntegrationtestCase::removeTemporaryHook() deprecated since 1.36,
+ now emit deprecation warnings.
* MessageCache::parse, ::parseWithPostProcessing and ::transform() are now
deprecated. Use MessageParser.
* User::getGlobalBlock(), deprecated since 1.40, now emits deprecation
diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php
index 9d5197fca9c..34060629991 100644
--- a/tests/phpunit/MediaWikiIntegrationTestCase.php
+++ b/tests/phpunit/MediaWikiIntegrationTestCase.php
@@ -2585,11 +2585,13 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
*
* @note This is implemented to remove ALL handlers for the given hook
* for the duration of the current test case.
- * @deprecated since 1.36, use clearHook() instead.
+ * @deprecated since 1.36, use clearHook() instead, hard deprecated
+ * since 1.44.
*
* @param string $hookName
*/
protected function removeTemporaryHook( $hookName ) {
+ wfDeprecated( __METHOD__, '1.36' );
$this->clearHook( $hookName );
}
diff --git a/tests/phpunit/includes/user/UserTest.php b/tests/phpunit/includes/user/UserTest.php
index 3bd89b2359f..51eab9a7f34 100644
--- a/tests/phpunit/includes/user/UserTest.php
+++ b/tests/phpunit/includes/user/UserTest.php
@@ -316,7 +316,7 @@ class UserTest extends MediaWikiIntegrationTestCase {
$status = $this->user->checkPasswordValidity( 'Password1234' );
$this->assertStatusWarning( 'isValidPassword returned false', $status );
- $this->removeTemporaryHook( 'isValidPassword' );
+ $this->clearHook( 'isValidPassword' );
$this->setTemporaryHook( 'isValidPassword', static function ( $password, &$result, $user ) {
$result = true;
@@ -325,7 +325,7 @@ class UserTest extends MediaWikiIntegrationTestCase {
$status = $this->user->checkPasswordValidity( 'Password1234' );
$this->assertStatusGood( $status );
- $this->removeTemporaryHook( 'isValidPassword' );
+ $this->clearHook( 'isValidPassword' );
$this->setTemporaryHook( 'isValidPassword', static function ( $password, &$result, $user ) {
$result = 'isValidPassword returned true';
@@ -334,7 +334,7 @@ class UserTest extends MediaWikiIntegrationTestCase {
$status = $this->user->checkPasswordValidity( 'Password1234' );
$this->assertStatusWarning( 'isValidPassword returned true', $status );
- $this->removeTemporaryHook( 'isValidPassword' );
+ $this->clearHook( 'isValidPassword' );
// On the forbidden list
$user = User::newFromName( 'Useruser' );
@@ -420,7 +420,7 @@ class UserTest extends MediaWikiIntegrationTestCase {
$user->logout();
$this->assertTrue( $user->isRegistered() );
- $this->removeTemporaryHook( 'UserLogout' );
+ $this->clearHook( 'UserLogout' );
$user->logout();
$this->assertFalse( $user->isRegistered() );
@@ -1389,7 +1389,7 @@ class UserTest extends MediaWikiIntegrationTestCase {
} );
$user->setEmail( 'TestEmail@mediawiki.org' );
- $this->removeTemporaryHook( 'UserSetEmail' );
+ $this->clearHook( 'UserSetEmail' );
$this->setTemporaryHook( 'UserSetEmail', static function ( $user, &$email ) {
$email = 'SettingIntercepted@mediawiki.org';
@@ -1410,8 +1410,8 @@ class UserTest extends MediaWikiIntegrationTestCase {
'Hooks can override getting email address'
);
- $this->removeTemporaryHook( 'UserGetEmail' );
- $this->removeTemporaryHook( 'UserSetEmail' );
+ $this->clearHook( 'UserGetEmail' );
+ $this->clearHook( 'UserSetEmail' );
$user->invalidateEmail();
$this->assertSame(
diff --git a/tests/phpunit/integration/includes/Permissions/RateLimiterTest.php b/tests/phpunit/integration/includes/Permissions/RateLimiterTest.php
index 5c7c2a68fff..dbd8cbbf343 100644
--- a/tests/phpunit/integration/includes/Permissions/RateLimiterTest.php
+++ b/tests/phpunit/integration/includes/Permissions/RateLimiterTest.php
@@ -249,7 +249,7 @@ class RateLimiterTest extends MediaWikiIntegrationTestCase {
$limiter->limit( $user, 'edit' ),
'Hooks that just return false leave $result false'
);
- $this->removeTemporaryHook( 'PingLimiter' );
+ $this->clearHook( 'PingLimiter' );
// Hook sets $result to true
$this->setTemporaryHook(
@@ -267,7 +267,7 @@ class RateLimiterTest extends MediaWikiIntegrationTestCase {
$limiter->limit( $user, 'read' ),
'The "read" permission will bypass the hook'
);
- $this->removeTemporaryHook( 'PingLimiter' );
+ $this->clearHook( 'PingLimiter' );
// Unknown action
$this->assertFalse(
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:32 AM (12 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227531
Default Alt Text
(4 KB)
Attached To
Mode
rMW mediawiki
Attached
Detach File
Event Timeline
Log In to Comment