mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-23 15:57:03 +00:00
Tag deletion logs performed with Nuke
Bug: T366068 Change-Id: I3455fab45698884d0b32f0065aaaf9fe7c0c6916
This commit is contained in:
parent
46c6b8b088
commit
e42a881976
|
@ -25,7 +25,9 @@
|
|||
}
|
||||
},
|
||||
"Hooks": {
|
||||
"ContributionsToolLinks": "main"
|
||||
"ContributionsToolLinks": "main",
|
||||
"ListDefinedTags": "MediaWiki\\Extension\\Nuke\\Hooks::onRegisterTags",
|
||||
"ChangeTagsListActive": "MediaWiki\\Extension\\Nuke\\Hooks::onRegisterTags"
|
||||
},
|
||||
"ResourceModules": {
|
||||
"ext.nuke.confirm": {
|
||||
|
|
|
@ -31,4 +31,14 @@ class Hooks implements ContributionsToolLinksHook {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers Nuke tag for deletion logs
|
||||
*
|
||||
* @param string[] &$tags
|
||||
*/
|
||||
public static function onRegisterTags( array &$tags ): bool {
|
||||
$tags[] = 'Nuke';
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -533,7 +533,7 @@ class SpecialNuke extends SpecialPage {
|
|||
'userId' => $user->getId(),
|
||||
'wikiPageId' => $title->getId(),
|
||||
'suppress' => false,
|
||||
'tags' => '[]',
|
||||
'tags' => '["Nuke"]',
|
||||
'logsubtype' => 'delete',
|
||||
] );
|
||||
$jobs[] = $job;
|
||||
|
|
|
@ -97,7 +97,8 @@ class HooksTest extends MediaWikiIntegrationTestCase {
|
|||
$services->getCommentFormatter(),
|
||||
$services->getUserFactory(),
|
||||
$services->getUserIdentityLookup(),
|
||||
$services->getDatabaseBlockStore()
|
||||
$services->getDatabaseBlockStore(),
|
||||
$services->getTempUserConfig()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -465,11 +465,12 @@ class SpecialNukeTest extends SpecialPageTestBase {
|
|||
|
||||
$this->assertStringContainsString( '(nuke-deletion-queued: Page123)', $html );
|
||||
$this->assertStringContainsString( '(nuke-deletion-queued: Paging456)', $html );
|
||||
|
||||
$this->assertStringNotContainsString( 'Nuke', $this->getDeleteLogHtml() );
|
||||
// Ensure all jobs are run
|
||||
$this->runJobs();
|
||||
|
||||
$this->assertStringContainsString( 'Vandalism', $this->getDeleteLogHtml() );
|
||||
$this->assertStringContainsString( 'Nuke', $this->getDeleteLogHtml() );
|
||||
$this->assertStringContainsString( $fauxReason, $this->getDeleteLogHtml() );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue