Daniel Kinzler has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387685 )

Change subject: Deprecate methods in Article that delegate to WikiPage
......................................................................

Deprecate methods in Article that delegate to WikiPage

The intent of this patch is to free us of the need to mirror
WikiPage's interface in the old Article class. This is a precondition
to splitting WikiPage into PageRecord, PageStore, and PageUpdater
for MCR.

Change-Id: I0335100b2bb41b783b73487b083b7fdef76e7ad9
---
M autoload.php
M includes/MediaWiki.php
M includes/actions/Action.php
M includes/actions/CachedAction.php
M includes/actions/CreditsAction.php
M includes/actions/DeleteAction.php
M includes/actions/EditAction.php
M includes/actions/FormAction.php
M includes/actions/HistoryAction.php
M includes/actions/InfoAction.php
M includes/actions/ProtectAction.php
M includes/actions/PurgeAction.php
M includes/actions/RawAction.php
M includes/actions/RenderAction.php
M includes/actions/RevertAction.php
M includes/actions/RollbackAction.php
M includes/actions/ViewAction.php
M includes/page/Article.php
M includes/page/Page.php
A includes/page/PageDisplayController.php
M includes/page/WikiPage.php
M tests/phpunit/includes/actions/ActionTest.php
22 files changed, 280 insertions(+), 73 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/387685/1

diff --git a/autoload.php b/autoload.php
index 3bee411..2d2111b 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1084,6 +1084,7 @@
        'Page' => __DIR__ . '/includes/page/Page.php',
        'PageArchive' => __DIR__ . '/includes/page/PageArchive.php',
        'PageDataRequestHandler' => __DIR__ . 
'/includes/linkeddata/PageDataRequestHandler.php',
+       'PageDisplayController' => __DIR__ . 
'/includes/page/PageDisplayController.php',
        'PageExists' => __DIR__ . '/maintenance/pageExists.php',
        'PageLangLogFormatter' => __DIR__ . 
'/includes/logging/PageLangLogFormatter.php',
        'PageProps' => __DIR__ . '/includes/PageProps.php',
diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 43de4ba..9f06a7e 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -458,23 +458,23 @@
        /**
         * Perform one of the "standard" actions
         *
-        * @param Page $page
+        * @param Article $article
         * @param Title $requestTitle The original title, before any redirects 
were applied
         */
-       private function performAction( Page $page, Title $requestTitle ) {
+       private function performAction( Article $article, Title $requestTitle ) 
{
                $request = $this->context->getRequest();
                $output = $this->context->getOutput();
                $title = $this->context->getTitle();
                $user = $this->context->getUser();
 
                if ( !Hooks::run( 'MediaWikiPerformAction',
-                               [ $output, $page, $title, $user, $request, 
$this ] )
+                               [ $output, $article, $title, $user, $request, 
$this ] )
                ) {
                        return;
                }
 
                $act = $this->getAction();
-               $action = Action::factory( $act, $page, $this->context );
+               $action = Action::factory( $act, $article, $this->context );
 
                if ( $action instanceof Action ) {
                        // Narrow DB query expectations for this HTTP request
@@ -504,7 +504,7 @@
                        'UnknownAction',
                        [
                                $request->getVal( 'action', 'view' ),
-                               $page
+                               $article
                        ],
                        '1.19'
                ) ) {
diff --git a/includes/actions/Action.php b/includes/actions/Action.php
index e8d9a3e..c8a72fa 100644
--- a/includes/actions/Action.php
+++ b/includes/actions/Action.php
@@ -39,7 +39,7 @@
        /**
         * Page on which we're performing the action
         * @since 1.17
-        * @var WikiPage|Article|ImagePage|CategoryPage|Page $page
+        * @var Article
         */
        protected $page;
 
@@ -84,27 +84,47 @@
        }
 
        /**
+        * @param WikiPage $page
+        *
+        * @return array
+        */
+       private static function getActionOverrides( WikiPage $page ) {
+               // TODO: action overrides need to take into account the target 
slot and the namespace.
+               return $page->getContentHandler()->getActionOverrides();
+       }
+
+       /**
         * Get an appropriate Action subclass for the given action
         * @since 1.17
         * @param string $action
-        * @param Page $page
+        * @param WikiPage|Article $article
         * @param IContextSource|null $context
         * @return Action|bool|null False if the action is disabled, null
         *     if it is not recognised
         */
-       final public static function factory( $action, Page $page, 
IContextSource $context = null ) {
-               $classOrCallable = self::getClass( $action, 
$page->getActionOverrides() );
+       final public static function factory( $action, $article, IContextSource 
$context = null ) {
+               if ( !$context ) {
+                       wfWarn( __METHOD__ . ' called without providing a 
Context object.' );
+                       $context = $article->getContext();
+               }
+
+               if ( $article instanceof WikiPage ) {
+                       $article = Article::newFromWikiPage( $article, $context 
);
+               }
+
+               $overrides = self::getActionOverrides( $article->getPage() );
+               $classOrCallable = self::getClass( $action, $overrides );
 
                if ( is_string( $classOrCallable ) ) {
                        if ( !class_exists( $classOrCallable ) ) {
                                return false;
                        }
-                       $obj = new $classOrCallable( $page, $context );
+                       $obj = new $classOrCallable( $article, $context );
                        return $obj;
                }
 
                if ( is_callable( $classOrCallable ) ) {
-                       return call_user_func_array( $classOrCallable, [ $page, 
$context ] );
+                       return call_user_func_array( $classOrCallable, [ 
$article, $context ] );
                }
 
                return $classOrCallable;
@@ -261,10 +281,10 @@
        /**
         * Only public since 1.21
         *
-        * @param Page $page
+        * @param Article $page
         * @param IContextSource|null $context
         */
-       public function __construct( Page $page, IContextSource $context = null 
) {
+       public function __construct( Article $page, IContextSource $context = 
null ) {
                if ( $context === null ) {
                        wfWarn( __METHOD__ . ' called without providing a 
Context object.' );
                        // NOTE: We could try to initialize $context using 
$page->getContext(),
@@ -295,6 +315,36 @@
        }
 
        /**
+        * @since 1.31
+        *
+        * @return WikiPage
+        */
+       protected function getWikiPage() {
+               return $this->page->getPage();
+       }
+
+       /**
+        * @since 1.31
+        *
+        * @deprecated since 1.31 use getWikiPage, getPageDisplayController, or 
move logic
+        * from Article into Action classes.
+        *
+        * @return Article
+        */
+       protected function getArticle() {
+               return $this->page;
+       }
+
+       /**
+        * @since 1.31
+        *
+        * @return PageDisplayController
+        */
+       protected function getDisplayController() {
+               return $this->page;
+       }
+
+       /**
         * Checks if the given user (identified by an object) can perform this 
action.  Can be
         * overridden by sub-classes with more complicated permissions schemes. 
 Failures here
         * must throw subclasses of ErrorPageError
diff --git a/includes/actions/CachedAction.php 
b/includes/actions/CachedAction.php
index 864094d..1d101c0 100644
--- a/includes/actions/CachedAction.php
+++ b/includes/actions/CachedAction.php
@@ -168,7 +168,7 @@
         */
        protected function getCacheKey() {
                return [
-                       get_class( $this->page ),
+                       get_class( $this->getArticle() ),
                        $this->getName(),
                        $this->getLanguage()->getCode()
                ];
diff --git a/includes/actions/CreditsAction.php 
b/includes/actions/CreditsAction.php
index ed58686..17267ab 100644
--- a/includes/actions/CreditsAction.php
+++ b/includes/actions/CreditsAction.php
@@ -44,7 +44,7 @@
         * @return string HTML
         */
        public function onView() {
-               if ( $this->page->getID() == 0 ) {
+               if ( $this->getWikiPage()->getID() == 0 ) {
                        $s = $this->msg( 'nocredits' )->parse();
                } else {
                        $s = $this->getCredits( -1 );
@@ -64,7 +64,7 @@
                $s = '';
 
                if ( $cnt != 0 ) {
-                       $s = $this->getAuthor( $this->page );
+                       $s = $this->getAuthor( $this->getWikiPage() );
                        if ( $cnt > 1 || $cnt < 0 ) {
                                $s .= ' ' . $this->getContributors( $cnt - 1, 
$showIfMax );
                        }
@@ -75,10 +75,10 @@
 
        /**
         * Get the last author with the last modification time
-        * @param Page $page
+        * @param WikiPage $page
         * @return string HTML
         */
-       protected function getAuthor( Page $page ) {
+       protected function getAuthor( WikiPage $page ) {
                $user = User::newFromName( $page->getUserText(), false );
 
                $timestamp = $page->getTimestamp();
@@ -113,7 +113,7 @@
         * @return string Html
         */
        protected function getContributors( $cnt, $showIfMax ) {
-               $contributors = $this->page->getContributors();
+               $contributors = $this->getWikiPage()->getContributors();
 
                $others_link = false;
 
diff --git a/includes/actions/DeleteAction.php 
b/includes/actions/DeleteAction.php
index 6bed59a..5ff7ca0 100644
--- a/includes/actions/DeleteAction.php
+++ b/includes/actions/DeleteAction.php
@@ -43,7 +43,7 @@
        public function show() {
                $this->useTransactionalTimeLimit();
                $this->addHelpLink( 'Help:Sysop deleting and undeleting' );
-               $this->page->delete();
+               $this->page->delete(); // TODO: move deletion UI into this class
        }
 
        public function doesWrites() {
diff --git a/includes/actions/EditAction.php b/includes/actions/EditAction.php
index f0bc8bf..de87651 100644
--- a/includes/actions/EditAction.php
+++ b/includes/actions/EditAction.php
@@ -51,11 +51,11 @@
                                'mediawiki.ui.checkbox',
                        ] );
                }
-               $page = $this->page;
+               $article = $this->getArticle();
                $user = $this->getUser();
 
-               if ( Hooks::run( 'CustomEditor', [ $page, $user ] ) ) {
-                       $editor = new EditPage( $page );
+               if ( Hooks::run( 'CustomEditor', [ $article, $user ] ) ) {
+                       $editor = new EditPage( $article );
                        $editor->setContextTitle( $this->getTitle() );
                        $editor->edit();
                }
diff --git a/includes/actions/FormAction.php b/includes/actions/FormAction.php
index 0141b9e..1496e90 100644
--- a/includes/actions/FormAction.php
+++ b/includes/actions/FormAction.php
@@ -74,7 +74,7 @@
                $this->fields = $this->getFormFields();
 
                // Give hooks a chance to alter the form, adding extra fields 
or text etc
-               Hooks::run( 'ActionModifyFormFields', [ $this->getName(), 
&$this->fields, $this->page ] );
+               Hooks::run( 'ActionModifyFormFields', [ $this->getName(), 
&$this->fields, $this->getArticle() ] );
 
                if ( $this->usesOOUI() ) {
                        $form = HTMLForm::factory( 'ooui', $this->fields, 
$this->getContext(), $this->getName() );
@@ -99,7 +99,7 @@
                $this->alterForm( $form );
 
                // Give hooks a chance to alter the form, adding extra fields 
or text etc
-               Hooks::run( 'ActionBeforeFormDisplay', [ $this->getName(), 
&$form, $this->page ] );
+               Hooks::run( 'ActionBeforeFormDisplay', [ $this->getName(), 
&$form, $this->getArticle() ] );
 
                return $form;
        }
diff --git a/includes/actions/HistoryAction.php 
b/includes/actions/HistoryAction.php
index a9a504d..3474f53 100644
--- a/includes/actions/HistoryAction.php
+++ b/includes/actions/HistoryAction.php
@@ -71,7 +71,7 @@
        }
 
        /**
-        * @return WikiPage|Article|ImagePage|CategoryPage|Page The Article 
object we are working on.
+        * @return Article
         */
        public function getArticle() {
                return $this->page;
@@ -101,7 +101,7 @@
                /**
                 * Allow client caching.
                 */
-               if ( $out->checkLastModified( $this->page->getTouched() ) ) {
+               if ( $out->checkLastModified( 
$this->getWikiPage()->getTouched() ) ) {
                        return; // Client cache fresh and headers sent, nothing 
more to do.
                }
 
@@ -142,7 +142,7 @@
                $this->addHelpLink( 
'//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Page_history', true );
 
                // Fail nicely if article doesn't exist.
-               if ( !$this->page->exists() ) {
+               if ( !$this->getWikiPage()->exists() ) {
                        global $wgSend404Code;
                        if ( $wgSend404Code ) {
                                $out->setStatusCode( 404 );
@@ -214,7 +214,8 @@
                        '</form>'
                );
 
-               Hooks::run( 'PageHistoryBeforeList', [ &$this->page, 
$this->getContext() ] );
+               $article = $this->getArticle();
+               Hooks::run( 'PageHistoryBeforeList', [ &$article, 
$this->getContext() ] );
 
                // Create and output the list.
                $pager = new HistoryPager( $this, $year, $month, $tagFilter, 
$conds );
@@ -256,7 +257,7 @@
                        $offsets = [];
                }
 
-               $page_id = $this->page->getId();
+               $page_id = $this->getWikiPage()->getId();
 
                return $dbr->select( 'revision',
                        Revision::selectFields(),
diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php
index 62f7ddf..73ba6cd 100644
--- a/includes/actions/InfoAction.php
+++ b/includes/actions/InfoAction.php
@@ -88,9 +88,9 @@
                $content = '';
 
                // Validate revision
-               $oldid = $this->page->getOldID();
+               $oldid = $this->getDisplayController()->getOldID();
                if ( $oldid ) {
-                       $revision = $this->page->getRevisionFetched();
+                       $revision = 
$this->getDisplayController()->getRevisionFetched();
 
                        // Revision is missing
                        if ( $revision === null ) {
@@ -211,7 +211,7 @@
                $config = $this->context->getConfig();
                $linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
 
-               $pageCounts = $this->pageCounts( $this->page );
+               $pageCounts = $this->pageCounts( $this->getWikiPage() );
 
                $pageProperties = [];
                $props = PageProps::getInstance()->getAllProperties( $title );
@@ -237,10 +237,10 @@
                if ( $title->isRedirect() ) {
                        $pageInfo['header-basic'][] = [
                                $this->msg( 'pageinfo-redirectsto' ),
-                               $linkRenderer->makeLink( 
$this->page->getRedirectTarget() ) .
+                               $linkRenderer->makeLink( 
$this->getWikiPage()->getRedirectTarget() ) .
                                $this->msg( 'word-separator' )->escaped() .
                                $this->msg( 'parentheses' )->rawParams( 
$linkRenderer->makeLink(
-                                       $this->page->getRedirectTarget(),
+                                       
$this->getWikiPage()->getRedirectTarget(),
                                        $this->msg( 'pageinfo-redirectsto-info' 
)->text(),
                                        [],
                                        [ 'action' => 'info' ]
@@ -322,7 +322,7 @@
                }
 
                // Use robot policy logic
-               $policy = $this->page->getRobotPolicy( 'view', $pOutput );
+               $policy = $this->getDisplayController()->getRobotPolicy( 
'view', $pOutput );
                $pageInfo['header-basic'][] = [
                        // Messages: pageinfo-robot-index, 
pageinfo-robot-noindex
                        $this->msg( 'pageinfo-robot-policy' ),
@@ -383,7 +383,7 @@
                ];
 
                // Is it counted as a content page?
-               if ( $this->page->isCountable() ) {
+               if ( $this->getWikiPage()->isCountable() ) {
                        $pageInfo['header-basic'][] = [
                                $this->msg( 'pageinfo-contentpage' ),
                                $this->msg( 'pageinfo-contentpage-yes' )
@@ -495,15 +495,15 @@
                        ];
                }
 
-               if ( !$this->page->exists() ) {
+               if ( !$this->getWikiPage()->exists() ) {
                        return $pageInfo;
                }
 
                // Edit history
                $pageInfo['header-edits'] = [];
 
-               $firstRev = $this->page->getOldestRevision();
-               $lastRev = $this->page->getRevision();
+               $firstRev = $this->getWikiPage()->getOldestRevision();
+               $lastRev = $this->getWikiPage()->getRevision();
                $batch = new LinkBatch;
 
                if ( $firstRev ) {
@@ -557,9 +557,9 @@
                                $this->msg( 'pageinfo-lasttime' ),
                                $linkRenderer->makeKnownLink(
                                        $title,
-                                       $lang->userTimeAndDate( 
$this->page->getTimestamp(), $user ),
+                                       $lang->userTimeAndDate( 
$this->getWikiPage()->getTimestamp(), $user ),
                                        [],
-                                       [ 'oldid' => $this->page->getLatest() ]
+                                       [ 'oldid' => 
$this->getWikiPage()->getLatest() ]
                                )
                        ];
                }
@@ -606,7 +606,7 @@
                }
 
                $localizedList = Html::rawElement( 'ul', [], implode( '', 
$listItems ) );
-               $hiddenCategories = $this->page->getHiddenCategories();
+               $hiddenCategories = $this->getWikiPage()->getHiddenCategories();
 
                if (
                        count( $listItems ) > 0 ||
@@ -693,10 +693,10 @@
        /**
         * Returns page counts that would be too "expensive" to retrieve by 
normal means.
         *
-        * @param WikiPage|Article|Page $page
+        * @param WikiPage $page
         * @return array
         */
-       protected function pageCounts( Page $page ) {
+       protected function pageCounts( WikiPage $page ) {
                $fname = __METHOD__;
                $config = $this->context->getConfig();
                $cache = 
MediaWikiServices::getInstance()->getMainWANObjectCache();
@@ -842,7 +842,7 @@
         * @return string Html
         */
        protected function getContributors() {
-               $contributors = $this->page->getContributors();
+               $contributors = $this->getWikiPage()->getContributors();
                $real_names = [];
                $user_names = [];
                $anon_ips = [];
diff --git a/includes/actions/ProtectAction.php 
b/includes/actions/ProtectAction.php
index 2e9e093..55a600b 100644
--- a/includes/actions/ProtectAction.php
+++ b/includes/actions/ProtectAction.php
@@ -49,7 +49,7 @@
                        ] );
                }
 
-               $this->page->protect();
+               $this->page->protect(); // TODO: move protection UI logic here
        }
 
        public function doesWrites() {
diff --git a/includes/actions/PurgeAction.php b/includes/actions/PurgeAction.php
index 904c6e2..3adce7a 100644
--- a/includes/actions/PurgeAction.php
+++ b/includes/actions/PurgeAction.php
@@ -42,7 +42,7 @@
        }
 
        public function onSubmit( $data ) {
-               return $this->page->doPurge();
+               return $this->getWikiPage()->doPurge();
        }
 
        public function show() {
diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php
index be10ae4..a4e54a6 100644
--- a/includes/actions/RawAction.php
+++ b/includes/actions/RawAction.php
@@ -55,7 +55,7 @@
                        return;
                }
 
-               if ( $this->getOutput()->checkLastModified( 
$this->page->getTouched() ) ) {
+               if ( $this->getOutput()->checkLastModified( 
$this->getWikiPage()->getTouched() ) ) {
                        return; // Client cache fresh and headers sent, nothing 
more to do.
                }
 
@@ -206,7 +206,7 @@
                                # output previous revision, or nothing if there 
isn't one
                                if ( !$oldid ) {
                                        # get the current revision so we can 
get the penultimate one
-                                       $oldid = $this->page->getLatest();
+                                       $oldid = 
$this->getWikiPage()->getLatest();
                                }
                                $previd = 
$this->getTitle()->getPreviousRevisionID( $oldid );
                                $oldid = $previd ?: -1;
diff --git a/includes/actions/RenderAction.php 
b/includes/actions/RenderAction.php
index 16e407f..0a5cbeb 100644
--- a/includes/actions/RenderAction.php
+++ b/includes/actions/RenderAction.php
@@ -41,6 +41,6 @@
        }
 
        public function show() {
-               $this->page->render();
+               $this->page->render(); // TODO: mave display UI logic here.
        }
 }
diff --git a/includes/actions/RevertAction.php 
b/includes/actions/RevertAction.php
index a914c9b..e0f960e 100644
--- a/includes/actions/RevertAction.php
+++ b/includes/actions/RevertAction.php
@@ -42,6 +42,14 @@
                return 'upload';
        }
 
+       /**
+        * @return File|false
+        */
+       public function getFile() {
+               // XXX: we just trust that $this->page is an ImagePage
+               return $this->page->getFile();
+       }
+
        protected function checkCanExecute( User $user ) {
                if ( $this->getTitle()->getNamespace() !== NS_FILE ) {
                        throw new ErrorPageError( $this->msg( 'nosuchaction' ), 
$this->msg( 'nosuchactiontext' ) );
@@ -100,7 +108,7 @@
                                'default' => $this->msg( 'filerevert-intro',
                                        $this->getTitle()->getText(), 
$userDate, $userTime,
                                        wfExpandUrl(
-                                               
$this->page->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage' 
) ),
+                                               
$this->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage' ) ),
                                                PROTO_CURRENT
                                        ) )->parseAsBlock()
                        ],
@@ -117,7 +125,7 @@
                $this->useTransactionalTimeLimit();
 
                $old = $this->getRequest()->getText( 'oldimage' );
-               $localFile = $this->page->getFile();
+               $localFile = $this->getFile();
                $oldFile = OldLocalFile::newFromArchiveName( $this->getTitle(), 
$localFile->getRepo(), $old );
 
                $source = $localFile->getArchiveVirtualUrl( $old );
@@ -148,7 +156,7 @@
 
                $this->getOutput()->addWikiMsg( 'filerevert-success', 
$this->getTitle()->getText(),
                        $userDate, $userTime,
-                       wfExpandUrl( $this->page->getFile()->getArchiveUrl( 
$this->getRequest()->getText( 'oldimage' ) ),
+                       wfExpandUrl( $this->getFile()->getArchiveUrl( 
$this->getRequest()->getText( 'oldimage' ) ),
                                PROTO_CURRENT
                ) );
                $this->getOutput()->returnToMain( false, $this->getTitle() );
diff --git a/includes/actions/RollbackAction.php 
b/includes/actions/RollbackAction.php
index 9d336e4..dd1d249 100644
--- a/includes/actions/RollbackAction.php
+++ b/includes/actions/RollbackAction.php
@@ -54,7 +54,7 @@
                $request = $this->getRequest();
                $user = $this->getUser();
                $from = $request->getVal( 'from' );
-               $rev = $this->page->getRevision();
+               $rev = $this->getWikiPage()->getRevision();
                if ( $from === null ) {
                        throw new ErrorPageError( 'rollbackfailed', 
'rollback-missingparam' );
                }
@@ -70,7 +70,7 @@
                }
 
                $data = null;
-               $errors = $this->page->doRollback(
+               $errors = $this->getWikiPage()->doRollback(
                        $from,
                        $request->getText( 'summary' ),
                        $request->getVal( 'token' ),
@@ -133,7 +133,7 @@
                );
 
                if ( $user->getBoolOption( 'watchrollback' ) ) {
-                       $user->addWatch( $this->page->getTitle(), 
User::IGNORE_USER_RIGHTS );
+                       $user->addWatch( $this->getWikiPage()->getTitle(), 
User::IGNORE_USER_RIGHTS );
                }
 
                $this->getOutput()->returnToMain( false, $this->getTitle() );
diff --git a/includes/actions/ViewAction.php b/includes/actions/ViewAction.php
index 134b8a4..9772280 100644
--- a/includes/actions/ViewAction.php
+++ b/includes/actions/ViewAction.php
@@ -42,17 +42,18 @@
 
        public function show() {
                $config = $this->context->getConfig();
+               $page = $this->getWikiPage();
 
                if (
                        $config->get( 'DebugToolbar' ) == false && // don't let 
this get stuck on pages
-                       $this->page->checkTouched() // page exists and is not a 
redirect
+                       $page->checkTouched() // page exists and is not a 
redirect
                ) {
                        // Include any redirect in the last-modified calculation
-                       $redirFromTitle = $this->page->getRedirectedFrom();
+                       $redirFromTitle = 
$this->getDisplayController()->getRedirectedFrom();
                        if ( !$redirFromTitle ) {
-                               $touched = $this->page->getTouched();
+                               $touched = $page->getTouched();
                        } elseif ( $config->get( 'MaxRedirects' ) <= 1 ) {
-                               $touched = max( $this->page->getTouched(), 
$redirFromTitle->getTouched() );
+                               $touched = max( $page->getTouched(), 
$redirFromTitle->getTouched() );
                        } else {
                                // Don't bother following the chain and getting 
the max mtime
                                $touched = null;
@@ -65,6 +66,6 @@
                        }
                }
 
-               $this->page->view();
+               $this->page->view(); // TODO: move view logic here into this 
class
        }
 }
diff --git a/includes/page/Article.php b/includes/page/Article.php
index df189af..7b44031 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -32,7 +32,7 @@
  * Note: edit user interface and cache support functions have been
  * moved to separate EditPage and HTMLFileCache classes.
  */
-class Article implements Page {
+class Article implements Page, PageDisplayController {
        /** @var IContextSource The context this Article is executed in */
        protected $mContext;
 
@@ -2015,10 +2015,11 @@
         */
        public function __get( $fname ) {
                if ( property_exists( $this->mPage, $fname ) ) {
-                       # wfWarn( "Access to raw $fname field " . __CLASS__ );
+                       wfWarn( "Access to raw $fname field " . __CLASS__ );
                        return $this->mPage->$fname;
                }
                trigger_error( 'Inaccessible property via __get(): ' . $fname, 
E_USER_NOTICE );
+               return null;
        }
 
        /**
@@ -2030,7 +2031,7 @@
         */
        public function __set( $fname, $fvalue ) {
                if ( property_exists( $this->mPage, $fname ) ) {
-                       # wfWarn( "Access to raw $fname field of " . __CLASS__ 
);
+                       wfWarn( "Access to raw $fname field of " . __CLASS__ );
                        $this->mPage->$fname = $fvalue;
                // Note: extensions may want to toss on new fields
                } elseif ( !in_array( $fname, [ 'mContext', 'mPage' ] ) ) {
@@ -2045,6 +2046,7 @@
         * @see WikiPage::checkFlags
         */
        public function checkFlags( $flags ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->checkFlags( $flags );
        }
 
@@ -2053,6 +2055,7 @@
         * @see WikiPage::checkTouched
         */
        public function checkTouched() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->checkTouched();
        }
 
@@ -2061,6 +2064,7 @@
         * @see WikiPage::clearPreparedEdit
         */
        public function clearPreparedEdit() {
+               wfDeprecated( __METHOD__, '1.31' );
                $this->mPage->clearPreparedEdit();
        }
 
@@ -2072,6 +2076,7 @@
                $reason, $suppress = false, $u1 = null, $u2 = null, &$error = 
'', User $user = null,
                $tags = []
        ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->doDeleteArticleReal(
                        $reason, $suppress, $u1, $u2, $error, $user, $tags
                );
@@ -2082,6 +2087,7 @@
         * @see WikiPage::doDeleteUpdates
         */
        public function doDeleteUpdates( $id, Content $content = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->doDeleteUpdates( $id, $content );
        }
 
@@ -2104,6 +2110,7 @@
         * @see WikiPage::doEditUpdates
         */
        public function doEditUpdates( Revision $revision, User $user, array 
$options = [] ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->doEditUpdates( $revision, $user, $options 
);
        }
 
@@ -2114,6 +2121,7 @@
         *  controlled how much purging was done.
         */
        public function doPurge() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->doPurge();
        }
 
@@ -2122,6 +2130,7 @@
         * @see WikiPage::doViewUpdates
         */
        public function doViewUpdates( User $user, $oldid = 0 ) {
+               wfDeprecated( __METHOD__, '1.31' );
                $this->mPage->doViewUpdates( $user, $oldid );
        }
 
@@ -2130,6 +2139,7 @@
         * @see WikiPage::exists
         */
        public function exists() {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used in 
ArticleBlacklist
                return $this->mPage->exists();
        }
 
@@ -2138,14 +2148,17 @@
         * @see WikiPage::followRedirect
         */
        public function followRedirect() {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used in 
ArticleBlacklist
                return $this->mPage->followRedirect();
        }
 
        /**
-        * Call to WikiPage function for backwards compatibility.
+        * @deprecated since 3.1, use Action::getActionOverrides instead.
+        *
         * @see ContentHandler::getActionOverrides
         */
        public function getActionOverrides() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getActionOverrides();
        }
 
@@ -2154,6 +2167,7 @@
         * @see WikiPage::getAutoDeleteReason
         */
        public function getAutoDeleteReason( &$hasHistory ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getAutoDeleteReason( $hasHistory );
        }
 
@@ -2162,6 +2176,7 @@
         * @see WikiPage::getCategories
         */
        public function getCategories() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getCategories();
        }
 
@@ -2170,6 +2185,7 @@
         * @see WikiPage::getComment
         */
        public function getComment( $audience = Revision::FOR_PUBLIC, User 
$user = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getComment( $audience, $user );
        }
 
@@ -2178,6 +2194,7 @@
         * @see WikiPage::getContentHandler
         */
        public function getContentHandler() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getContentHandler();
        }
 
@@ -2186,6 +2203,7 @@
         * @see WikiPage::getContentModel
         */
        public function getContentModel() {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used in 
AbuseFilter
                return $this->mPage->getContentModel();
        }
 
@@ -2194,6 +2212,7 @@
         * @see WikiPage::getContributors
         */
        public function getContributors() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getContributors();
        }
 
@@ -2202,6 +2221,7 @@
         * @see WikiPage::getCreator
         */
        public function getCreator( $audience = Revision::FOR_PUBLIC, User 
$user = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getCreator( $audience, $user );
        }
 
@@ -2210,6 +2230,7 @@
         * @see WikiPage::getDeletionUpdates
         */
        public function getDeletionUpdates( Content $content = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getDeletionUpdates( $content );
        }
 
@@ -2218,6 +2239,7 @@
         * @see WikiPage::getHiddenCategories
         */
        public function getHiddenCategories() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getHiddenCategories();
        }
 
@@ -2226,6 +2248,7 @@
         * @see WikiPage::getId
         */
        public function getId() {
+               // FIXME: used by OAI
                return $this->mPage->getId();
        }
 
@@ -2234,6 +2257,7 @@
         * @see WikiPage::getLatest
         */
        public function getLatest() {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used by 
FlaggedRevs
                return $this->mPage->getLatest();
        }
 
@@ -2242,6 +2266,7 @@
         * @see WikiPage::getLinksTimestamp
         */
        public function getLinksTimestamp() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getLinksTimestamp();
        }
 
@@ -2250,6 +2275,7 @@
         * @see WikiPage::getMinorEdit
         */
        public function getMinorEdit() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getMinorEdit();
        }
 
@@ -2258,6 +2284,7 @@
         * @see WikiPage::getOldestRevision
         */
        public function getOldestRevision() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getOldestRevision();
        }
 
@@ -2266,6 +2293,7 @@
         * @see WikiPage::getRedirectTarget
         */
        public function getRedirectTarget() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getRedirectTarget();
        }
 
@@ -2274,6 +2302,7 @@
         * @see WikiPage::getRedirectURL
         */
        public function getRedirectURL( $rt ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getRedirectURL( $rt );
        }
 
@@ -2282,6 +2311,7 @@
         * @see WikiPage::getRevision
         */
        public function getRevision() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getRevision();
        }
 
@@ -2290,6 +2320,7 @@
         * @see WikiPage::getTimestamp
         */
        public function getTimestamp() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getTimestamp();
        }
 
@@ -2298,6 +2329,7 @@
         * @see WikiPage::getTouched
         */
        public function getTouched() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getTouched();
        }
 
@@ -2306,6 +2338,7 @@
         * @see WikiPage::getUndoContent
         */
        public function getUndoContent( Revision $undo, Revision $undoafter = 
null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getUndoContent( $undo, $undoafter );
        }
 
@@ -2314,6 +2347,7 @@
         * @see WikiPage::getUser
         */
        public function getUser( $audience = Revision::FOR_PUBLIC, User $user = 
null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getUser( $audience, $user );
        }
 
@@ -2322,6 +2356,7 @@
         * @see WikiPage::getUserText
         */
        public function getUserText( $audience = Revision::FOR_PUBLIC, User 
$user = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->getUserText( $audience, $user );
        }
 
@@ -2330,6 +2365,7 @@
         * @see WikiPage::hasViewableContent
         */
        public function hasViewableContent() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->hasViewableContent();
        }
 
@@ -2338,6 +2374,7 @@
         * @see WikiPage::insertOn
         */
        public function insertOn( $dbw, $pageId = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->insertOn( $dbw, $pageId );
        }
 
@@ -2348,6 +2385,7 @@
        public function insertProtectNullRevision( $revCommentMsg, array $limit,
                array $expiry, $cascade, $reason, $user = null
        ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->insertProtectNullRevision( $revCommentMsg, 
$limit,
                        $expiry, $cascade, $reason, $user
                );
@@ -2358,6 +2396,7 @@
         * @see WikiPage::insertRedirect
         */
        public function insertRedirect() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->insertRedirect();
        }
 
@@ -2366,6 +2405,7 @@
         * @see WikiPage::insertRedirectEntry
         */
        public function insertRedirectEntry( Title $rt, $oldLatest = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->insertRedirectEntry( $rt, $oldLatest );
        }
 
@@ -2374,6 +2414,7 @@
         * @see WikiPage::isCountable
         */
        public function isCountable( $editInfo = false ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->isCountable( $editInfo );
        }
 
@@ -2382,6 +2423,7 @@
         * @see WikiPage::isRedirect
         */
        public function isRedirect() {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used by 
ProtectionForm
                return $this->mPage->isRedirect();
        }
 
@@ -2390,6 +2432,7 @@
         * @see WikiPage::loadFromRow
         */
        public function loadFromRow( $data, $from ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->loadFromRow( $data, $from );
        }
 
@@ -2398,6 +2441,7 @@
         * @see WikiPage::loadPageData
         */
        public function loadPageData( $from = 'fromdb' ) {
+               wfDeprecated( __METHOD__, '1.31' );
                $this->mPage->loadPageData( $from );
        }
 
@@ -2406,6 +2450,7 @@
         * @see WikiPage::lockAndGetLatest
         */
        public function lockAndGetLatest() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->lockAndGetLatest();
        }
 
@@ -2414,6 +2459,7 @@
         * @see WikiPage::makeParserOptions
         */
        public function makeParserOptions( $context ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->makeParserOptions( $context );
        }
 
@@ -2422,6 +2468,7 @@
         * @see WikiPage::pageDataFromId
         */
        public function pageDataFromId( $dbr, $id, $options = [] ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->pageDataFromId( $dbr, $id, $options );
        }
 
@@ -2430,6 +2477,7 @@
         * @see WikiPage::pageDataFromTitle
         */
        public function pageDataFromTitle( $dbr, $title, $options = [] ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->pageDataFromTitle( $dbr, $title, $options 
);
        }
 
@@ -2441,6 +2489,7 @@
                Content $content, $revision = null, User $user = null,
                $serialFormat = null, $useCache = true
        ) {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used by 
SpamBlacklist
                return $this->mPage->prepareContentForEdit(
                        $content, $revision, $user,
                        $serialFormat, $useCache
@@ -2452,6 +2501,7 @@
         * @see WikiPage::protectDescription
         */
        public function protectDescription( array $limit, array $expiry ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->protectDescription( $limit, $expiry );
        }
 
@@ -2460,6 +2510,7 @@
         * @see WikiPage::protectDescriptionLog
         */
        public function protectDescriptionLog( array $limit, array $expiry ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->protectDescriptionLog( $limit, $expiry );
        }
 
@@ -2470,6 +2521,7 @@
        public function replaceSectionAtRev( $sectionId, Content 
$sectionContent,
                $sectionTitle = '', $baseRevId = null
        ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->replaceSectionAtRev( $sectionId, 
$sectionContent,
                        $sectionTitle, $baseRevId
                );
@@ -2482,6 +2534,7 @@
        public function replaceSectionContent(
                $sectionId, Content $sectionContent, $sectionTitle = '', 
$edittime = null
        ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->replaceSectionContent(
                        $sectionId, $sectionContent, $sectionTitle, $edittime
                );
@@ -2492,7 +2545,8 @@
         * @see WikiPage::setTimestamp
         */
        public function setTimestamp( $ts ) {
-               return $this->mPage->setTimestamp( $ts );
+               wfDeprecated( __METHOD__, '1.31' );
+               $this->mPage->setTimestamp( $ts );
        }
 
        /**
@@ -2500,6 +2554,7 @@
         * @see WikiPage::shouldCheckParserCache
         */
        public function shouldCheckParserCache( ParserOptions $parserOptions, 
$oldId ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->shouldCheckParserCache( $parserOptions, 
$oldId );
        }
 
@@ -2508,6 +2563,7 @@
         * @see WikiPage::supportsSections
         */
        public function supportsSections() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->supportsSections();
        }
 
@@ -2516,6 +2572,7 @@
         * @see WikiPage::triggerOpportunisticLinksUpdate
         */
        public function triggerOpportunisticLinksUpdate( ParserOutput 
$parserOutput ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->triggerOpportunisticLinksUpdate( 
$parserOutput );
        }
 
@@ -2524,6 +2581,7 @@
         * @see WikiPage::updateCategoryCounts
         */
        public function updateCategoryCounts( array $added, array $deleted, $id 
= 0 ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->updateCategoryCounts( $added, $deleted, 
$id );
        }
 
@@ -2532,6 +2590,7 @@
         * @see WikiPage::updateIfNewerOn
         */
        public function updateIfNewerOn( $dbw, $revision ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->updateIfNewerOn( $dbw, $revision );
        }
 
@@ -2540,6 +2599,7 @@
         * @see WikiPage::updateRedirectOn
         */
        public function updateRedirectOn( $dbw, $redirectTitle, 
$lastRevIsRedirect = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->updateRedirectOn( $dbw, $redirectTitle, 
$lastRevIsRedirect = null );
        }
 
@@ -2550,6 +2610,7 @@
        public function updateRevisionOn( $dbw, $revision, $lastRevision = null,
                $lastRevIsRedirect = null
        ) {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used by OAI
                return $this->mPage->updateRevisionOn( $dbw, $revision, 
$lastRevision,
                        $lastRevIsRedirect
                );
@@ -2566,6 +2627,7 @@
        public function doUpdateRestrictions( array $limit, array $expiry, 
&$cascade,
                $reason, User $user
        ) {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used by 
ProtectionForm
                return $this->mPage->doUpdateRestrictions( $limit, $expiry, 
$cascade, $reason, $user );
        }
 
@@ -2579,6 +2641,7 @@
        public function updateRestrictions( $limit = [], $reason = '',
                &$cascade = 0, $expiry = []
        ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->mPage->doUpdateRestrictions(
                        $limit,
                        $expiry,
@@ -2599,6 +2662,7 @@
        public function doDeleteArticle(
                $reason, $suppress = false, $u1 = null, $u2 = null, &$error = ''
        ) {
+               wfDeprecated( __METHOD__, '1.31' ); // FIXME: used by OAI
                return $this->mPage->doDeleteArticle( $reason, $suppress, $u1, 
$u2, $error );
        }
 
@@ -2612,6 +2676,7 @@
         * @return array
         */
        public function doRollback( $fromP, $summary, $token, $bot, 
&$resultDetails, User $user = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                $user = is_null( $user ) ? $this->getContext()->getUser() : 
$user;
                return $this->mPage->doRollback( $fromP, $summary, $token, 
$bot, $resultDetails, $user );
        }
@@ -2625,6 +2690,7 @@
         * @return array
         */
        public function commitRollback( $fromP, $summary, $bot, 
&$resultDetails, User $guser = null ) {
+               wfDeprecated( __METHOD__, '1.31' );
                $guser = is_null( $guser ) ? $this->getContext()->getUser() : 
$guser;
                return $this->mPage->commitRollback( $fromP, $summary, $bot, 
$resultDetails, $guser );
        }
diff --git a/includes/page/Page.php b/includes/page/Page.php
index 2cb1fc0..b0ed3e6 100644
--- a/includes/page/Page.php
+++ b/includes/page/Page.php
@@ -20,6 +20,8 @@
 
 /**
  * Interface for type hinting (accepts WikiPage, Article, ImagePage, 
CategoryPage)
+ *
+ * @deprecated use WikiPage or Article instead.
  */
 interface Page {
 }
diff --git a/includes/page/PageDisplayController.php 
b/includes/page/PageDisplayController.php
new file mode 100644
index 0000000..0f19358
--- /dev/null
+++ b/includes/page/PageDisplayController.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * Interface for a component that controls page display beased on a user 
request.
+ *
+ * This interface was designed to cover the part of the old Article class that
+ * is concerned with controlling page display.
+ *
+ * @since 1.31
+ */
+interface PageDisplayController {
+
+       /**
+        * @return int The oldid of the article that is to be shown, 0 for the 
current revision
+        */
+       public function getOldID();
+
+       /**
+        * Returns true if the currently-referenced revision is the current edit
+        * to this page (and it exists).
+        * @return bool
+        */
+       public function isCurrent();
+
+       /**
+        * Get the fetched Revision object depending on request parameters or 
null
+        * on failure.
+        *
+        * @return Revision|null
+        */
+       public function getRevisionFetched();
+
+       /**
+        * Use this to fetch the rev ID used on page views
+        *
+        * @return int Revision ID of last article revision
+        */
+       public function getRevIdFetched();
+
+       /**
+        * Get the robot policy to be used for the current view
+        * @param string $action The action= GET parameter
+        * @param ParserOutput|null $pOutput
+        * @return array The policy that should be set
+        * @todo actions other than 'view'
+        */
+       public function getRobotPolicy( $action, $pOutput = null );
+
+       /**
+        * Get the page this view was redirected from
+        * @return Title|null
+        */
+       public function getRedirectedFrom();
+
+}
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 146c054..423803b 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -34,7 +34,7 @@
  * Some fields are public only for backwards-compatibility. Use accessors.
  * In the past, this class was part of Article.php and everything was public.
  */
-class WikiPage implements Page, IDBAccessObject {
+class WikiPage implements IDBAccessObject {
        // Constants for $mDataLoadedFrom and related
 
        /**
@@ -204,12 +204,13 @@
        }
 
        /**
-        * @todo Move this UI stuff somewhere else
+        * @deprecated since 3.1, use Action::getActionOverrides instead.
         *
         * @see ContentHandler::getActionOverrides
         * @return array
         */
        public function getActionOverrides() {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->getContentHandler()->getActionOverrides();
        }
 
diff --git a/tests/phpunit/includes/actions/ActionTest.php 
b/tests/phpunit/includes/actions/ActionTest.php
index 4a30292..721d2a9 100644
--- a/tests/phpunit/includes/actions/ActionTest.php
+++ b/tests/phpunit/includes/actions/ActionTest.php
@@ -14,6 +14,7 @@
                parent::setUp();
 
                $context = $this->getContext();
+               $article = Article::newFromWikiPage( $context->getWikiPage(), 
$context );
                $this->setMwGlobals( 'wgActions', [
                        'null' => null,
                        'disabled' => false,
@@ -24,7 +25,7 @@
                        'string' => 'NamedDummyAction',
                        'declared' => 'NonExistingClassName',
                        'callable' => [ $this, 'dummyActionCallback' ],
-                       'object' => new InstantiatedDummyAction( 
$context->getWikiPage(), $context ),
+                       'object' => new InstantiatedDummyAction( $article, 
$context ),
                ] );
        }
 
@@ -152,7 +153,8 @@
 
        public function testNull_canNotBeInstantiated() {
                $page = $this->getPage();
-               $action = Action::factory( null, $page );
+               $context = $this->getContext( null );
+               $action = Action::factory( null, $page, $context );
 
                $this->assertNull( $action );
        }
@@ -172,14 +174,16 @@
 
        public function testDisabledAction_factoryReturnsFalse() {
                $page = $this->getPage();
-               $action = Action::factory( 'disabled', $page );
+               $context = $this->getContext( null );
+               $action = Action::factory( 'disabled', $page, $context );
 
                $this->assertFalse( $action );
        }
 
        public function dummyActionCallback() {
                $context = $this->getContext();
-               return new CalledDummyAction( $context->getWikiPage(), $context 
);
+               $article = Article::newFromWikiPage( $context->getWikiPage(), 
$context );
+               return new CalledDummyAction( $article, $context );
        }
 
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/387685
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0335100b2bb41b783b73487b083b7fdef76e7ad9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <daniel.kinz...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to