Implement FauxRequest::getRequestURL() - needed for MF tests
authorMax Semenik <maxsem.wiki@gmail.com>
Thu, 25 Sep 2014 21:41:51 +0000 (14:41 -0700)
committerMax Semenik <maxsem.wiki@gmail.com>
Thu, 25 Sep 2014 21:41:51 +0000 (14:41 -0700)
Change-Id: Ib780582cdc68cb770c5fd12d805f4561bc0e2a13

includes/WebRequest.php

index b187c4a..1cbdbf9 100644 (file)
@@ -1255,6 +1255,7 @@ class WebRequestUpload {
 class FauxRequest extends WebRequest {
        private $wasPosted = false;
        private $session = array();
+       private $requestUrl;
 
        /**
         * @param array $data Array of *non*-urlencoded key => value pairs, the
@@ -1334,8 +1335,15 @@ class FauxRequest extends WebRequest {
                return false;
        }
 
+       public function setRequestURL( $url ) {
+               $this->requestUrl = $url;
+       }
+
        public function getRequestURL() {
-               $this->notImplemented( __METHOD__ );
+               if ( $this->requestUrl === null ) {
+                       throw new MWException( 'Request URL not set' );
+               }
+               return $this->requestUrl;
        }
 
        public function getProtocol() {