MediaWikiServices::getInstance()->disableService( 'MediaHandlerFactory' );
MediaWikiServices::getInstance()->redefineService(
'MediaHandlerFactory',
- function () {
- return new MockMediaHandlerFactory();
+ function ( MediaWikiServices $services ) {
+ $handlers = $services->getMainConfig()->get( 'ParserTestMediaHandlers' );
+ return new MediaHandlerFactory( $handlers );
}
);
$teardown[] = function () {
* @see staticSetup
*
* @param array $teardown The snippet array
- * @param ScopedCallback|null A ScopedCallback to consume
+ * @param ScopedCallback|null $nextTeardown A ScopedCallback to consume
* @return ScopedCallback
*/
protected function createTeardownObject( $teardown, $nextTeardown = null ) {
* Determine whether a particular setup function has been run
*
* @param string $funcName
- * @return boolean
+ * @return bool
*/
public function isSetupDone( $funcName ) {
return isset( $this->setupDone[$funcName] ) ? $this->setupDone[$funcName] : false;
// wgEnableMagicLinks={"ISBN":false, "PMID":false, "RFC":false}
'wgEnableMagicLinks' => self::getOptionValue( 'wgEnableMagicLinks', $opts, [] )
+ [ 'ISBN' => true, 'PMID' => true, 'RFC' => true ],
+ // Test with legacy encoding by default until HTML5 is very stable and default
+ 'wgFragmentMode' => [ 'legacy' ],
];
if ( $config ) {
/**
* Add articles to the test DB.
*
- * @param $articles Article info array from TestFileReader
+ * @param array $articles Article info array from TestFileReader
*/
public function addArticles( $articles ) {
global $wgContLang;