镜像自地址
https://github.com/wikimedia/mediawiki-extensions-RevisionSlider
已同步 2024-05-25 06:12:56 +08: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
这个提交包含在:
父节点
e482005b2e
当前提交
b1d8a16d2d
|
@ -45,12 +45,6 @@ class RevisionSliderHooks implements DifferenceEngineViewHeaderHook, GetPreferen
|
||||||
$oldRevRecord = $differenceEngine->getOldRevision();
|
$oldRevRecord = $differenceEngine->getOldRevision();
|
||||||
$newRevRecord = $differenceEngine->getNewRevision();
|
$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.
|
* 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 );
|
$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() {
|
public function testShouldNotLoadWhenUserIsLoggedInAndDisabledExtension() {
|
||||||
// Arrange
|
// Arrange
|
||||||
$options = [ 'revisionslider-disable' => true ];
|
$options = [ 'revisionslider-disable' => true ];
|
||||||
|
|
正在加载...
在新工单中引用
屏蔽一个用户