$user = $this->mRecord->getUser( $audience, $user );
return $user ? $user->getName() : '';
}
+
/**
* Fetch revision comment if it's available to the specified audience.
* If the specified audience does not have access to the comment, an
public function setLanguage( Language $language ) {
$this->language = $language;
}
+
/**
* @param int $cutoff
* @see $wgWikiDiff2MovedParagraphDetectionCutoff
'handle this content model.' );
$this->modelId = $modelId;
}
+
/** @return string */
public function getModelId() {
return $this->modelId;
* @see FileBackend::doOperations()
* @param array $ops
* @param array $opts
+ * @return StatusValue
*/
abstract protected function doOperationsInternal( array $ops, array $opts );
/**
* @see FileBackend::doQuickOperations()
* @param array $ops
+ * @return StatusValue
* @since 1.20
*/
abstract protected function doQuickOperationsInternal( array $ops );
/**
* @see FileBackend::prepare()
* @param array $params
+ * @return StatusValue
*/
abstract protected function doPrepare( array $params );
/**
* @see FileBackend::secure()
* @param array $params
+ * @return StatusValue
*/
abstract protected function doSecure( array $params );
/**
* @see FileBackend::publish()
* @param array $params
+ * @return StatusValue
*/
abstract protected function doPublish( array $params );
/**
* @see FileBackend::clean()
* @param array $params
+ * @return StatusValue
*/
abstract protected function doClean( array $params );
$this->filterMatchType = $callbackReturn;
}
}
+
/**
* Handle coming across a <!DOCTYPE declaration.
*
public function getMagicPMIDLinks() {
return $this->getOption( 'magicPMIDLinks' );
}
+
/**
* Are magic RFC links enabled?
* @since 1.28
$pageRestrictions[] = $restriction->getTitle()->getPrefixedText();
}
+ if ( !$block->isSitewide() && empty( $pageRestrictions ) ) {
+ $fields['Editing']['default'] = false;
+ }
+
// Sort the restrictions so they are in alphabetical order.
sort( $pageRestrictions );
$fields['PageRestrictions']['default'] = implode( "\n", $pageRestrictions );
* @return bool|array True for success, false for didn't-try, array of errors on failure
*/
public function onSubmit( array $data, HTMLForm $form = null ) {
+ // If "Editing" checkbox is unchecked, the block must be a partial block affecting
+ // actions other than editing, and there must be no restrictions.
+ if ( isset( $data['Editing'] ) && $data['Editing'] === false ) {
+ $data['EditingRestriction'] = 'partial';
+ $data['PageRestrictions'] = [];
+ }
return self::processForm( $data, $form->getContext() );
}
$this->output = $specialSearch->getOutput();
$this->showMultimedia = $showMultimedia;
}
+
/**
* @param string $term User provided search term
* @param SearchResultSet|SearchResultSet[] $resultSets List of interwiki
$this->testPageTitle = Title::newFromText( 'UTPage-' . __CLASS__ );
return $this->testPageTitle;
}
+
/**
* @return WikiPage
*/
// Allocated file for testing
$this->tempFileName = tempnam( wfTempDir(), 'WEBP' );
}
+
public function tearDown() {
parent::tearDown();
unlink( $this->tempFileName );
}
+
/**
* @dataProvider provideTestExtractMetaData
*/
$this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $this->tempFileName ) );
}
+
public function provideTestExtractMetaData() {
// phpcs:disable Generic.Files.LineLength
return [
public function testWithFileExtractMetaData( $filename, $expectedResult ) {
$this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $filename ) );
}
+
public function provideTestWithFileExtractMetaData() {
return [
[ __DIR__ . '/../../data/media/2_webp_ll.webp',
$handler = new WebPHandler();
$this->assertEquals( $expectedResult, $handler->getImageSize( null, $path ) );
}
+
public function provideTestGetImageSize() {
return [
// Public domain files from https://developers.google.com/speed/webp/gallery2
$mime = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$this->assertEquals( 'image/webp', $mime->guessMimeType( $path, false ) );
}
+
public function provideTestGetMimeType() {
return [
// Public domain files from https://developers.google.com/speed/webp/gallery2
}
];
}
+
/**
* @dataProvider provideMagicWords
*/
]
];
}
+
/**
* @dataProvider providerWrapAndEscapeMessage
* @covers ResourceLoaderLessVarFileModule::wrapAndEscapeMessage
] ]
];
}
+
/**
* @covers ResourceLoaderStartUpModule::getModuleRegistrations
* @dataProvider provideRegistrations
$response
);
}
+
/**
* Verify that when building the startup module response,
* an exception from one module class will not break the entire
] ) ],
];
}
+
/**
* @dataProvider provideValidRequests
*/