* @param array $args Array of form [ category name => sort key ]
* @param array $fakeResults Array of form [ category name => value to return from mocked
* LinkBatch ]
- * @param callback $variantLinkCallback Callback to replace findVariantLink() call
+ * @param callable $variantLinkCallback Callback to replace findVariantLink() call
* @param array $expectedNormal Expected return value of getCategoryLinks['normal']
* @param array $expectedHidden Expected return value of getCategoryLinks['hidden']
*/
$nonce->setAccessible( true );
$nonce->setValue( $out, 'secret' );
$rl = $out->getResourceLoader();
- $rl->setMessageBlobStore( new NullMessageBlobStore() );
+ $rl->setMessageBlobStore( $this->createMock( MessageBlobStore::class ) );
$rl->register( [
'test.foo' => new ResourceLoaderTestModule( [
'script' => 'mw.test.foo( { a: true } );',
->method( 'buildCssLinksArray' )
->willReturn( [] );
$rl = $op->getResourceLoader();
- $rl->setMessageBlobStore( new NullMessageBlobStore() );
+ $rl->setMessageBlobStore( $this->createMock( MessageBlobStore::class ) );
// Register custom modules
$rl->register( [
return new OutputPage( $context );
}
}
-
-/**
- * MessageBlobStore that doesn't do anything
- */
-class NullMessageBlobStore extends MessageBlobStore {
- public function get( ResourceLoader $resourceLoader, $modules, $lang ) {
- return [];
- }
-
- public function updateModule( $name, ResourceLoaderModule $module, $lang ) {
- }
-
- public function updateMessage( $key ) {
- }
-
- public function clear() {
- }
-}