+ /**
+ * @covers FauxRequest::getFullRequestURL
+ */
+ public function testGetFullRequestURL_disallowed() {
+ $GLOBALS['wgServer'] = '//wiki.test';
+ $req = new FauxRequest();
+
+ $this->setExpectedException( MWException::class );
+ $req->getFullRequestURL();
+ }
+
+ /**
+ * @covers FauxRequest::getFullRequestURL
+ */
+ public function testGetFullRequestURL_http() {
+ $GLOBALS['wgServer'] = '//wiki.test';
+ $req = new FauxRequest();
+ $req->setRequestURL( '/path' );
+
+ $this->assertSame(
+ 'http://wiki.test/path',
+ $req->getFullRequestURL()
+ );
+ }
+
+ /**
+ * @covers FauxRequest::getFullRequestURL
+ */
+ public function testGetFullRequestURL_https() {
+ $GLOBALS['wgServer'] = '//wiki.test';
+ $req = new FauxRequest( [], false, null, 'https' );
+ $req->setRequestURL( '/path' );
+
+ $this->assertSame(
+ 'https://wiki.test/path',
+ $req->getFullRequestURL()
+ );
+ }
+