mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-09-23 10:24:07 +00:00
Remove dead code
The MobileDiff page no longer exists, and was replaced with a redirect that redirects to the desktop diff page, so this code can safely be removed. Bug: T360389 Change-Id: I8ebe2bc88a650caf29a5755013e980fe3b5aaeb0
This commit is contained in:
parent
e482005b2e
commit
b1d8a16d2d
|
@ -45,12 +45,6 @@ class RevisionSliderHooks implements DifferenceEngineViewHeaderHook, GetPreferen
|
|||
$oldRevRecord = $differenceEngine->getOldRevision();
|
||||
$newRevRecord = $differenceEngine->getNewRevision();
|
||||
|
||||
// do not show on MobileDiff page
|
||||
// Note: Since T245172, DifferenceEngine::getTitle() is the title of the page being diffed.
|
||||
if ( $differenceEngine->getOutput()->getTitle()->isSpecial( 'MobileDiff' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the user is logged in and has explictly requested to disable the extension don't load.
|
||||
*/
|
||||
|
|
|
@ -30,28 +30,6 @@ class RevisionSliderHooksTest extends \MediaWikiIntegrationTestCase {
|
|||
$this->newInstance()->onDifferenceEngineViewHeader( $diffEngine );
|
||||
}
|
||||
|
||||
public function testShouldNotLoadOnMobileDiff() {
|
||||
// Arrange
|
||||
$title = $this->createMock( Title::class );
|
||||
$title->method( 'isSpecial' )
|
||||
->with( 'MobileDiff' )
|
||||
->willReturn( true );
|
||||
|
||||
$output = $this->createMock( OutputPage::class );
|
||||
$output->method( 'getTitle' )
|
||||
->willReturn( $title );
|
||||
|
||||
$revision = $this->createMock( RevisionRecord::class );
|
||||
$diffEngine = $this->newDiffEngine( $revision, $output );
|
||||
|
||||
// Assert
|
||||
$output->expects( $this->never() )
|
||||
->method( 'addModules' );
|
||||
|
||||
// Act
|
||||
$this->newInstance()->onDifferenceEngineViewHeader( $diffEngine );
|
||||
}
|
||||
|
||||
public function testShouldNotLoadWhenUserIsLoggedInAndDisabledExtension() {
|
||||
// Arrange
|
||||
$options = [ 'revisionslider-disable' => true ];
|
||||
|
|
Loading…
Reference in a new issue