mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-27 09:40:43 +00:00
Merge "Tag deletion logs performed with Nuke"
This commit is contained in:
commit
dd5715525e
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -628,7 +628,7 @@ class SpecialNuke extends SpecialPage {
|
|||
'userId' => $user->getId(),
|
||||
'wikiPageId' => $title->getId(),
|
||||
'suppress' => false,
|
||||
'tags' => '[]',
|
||||
'tags' => '["Nuke"]',
|
||||
'logsubtype' => 'delete',
|
||||
] );
|
||||
$jobs[] = $job;
|
||||
|
|
|
@ -670,11 +670,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