mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-02 18:06:16 +00:00
2216426f61
This was not doing anything any more after I50b20ed. Change-Id: I5af8f9cd2f6fb94b3bb007b72417dcb7a7f67ac9
39 lines
980 B
PHP
39 lines
980 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\VisualEditor\Tests;
|
|
|
|
use MediaWiki\Config\HashConfig;
|
|
use MediaWiki\Extension\VisualEditor\Hooks;
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\VisualEditor\Hooks
|
|
* @group Database
|
|
*/
|
|
class HooksTest extends MediaWikiIntegrationTestCase {
|
|
|
|
/**
|
|
* @dataProvider provideOnResourceLoaderGetConfigVars
|
|
*/
|
|
public function testOnResourceLoaderGetConfigVars( array $config, array $expected ) {
|
|
$this->overrideConfigValues( $config );
|
|
|
|
$vars = [];
|
|
( new Hooks() )->onResourceLoaderGetConfigVars( $vars, '', new HashConfig() );
|
|
|
|
$this->assertArrayHasKey( 'wgVisualEditorConfig', $vars );
|
|
$veConfig = $vars['wgVisualEditorConfig'];
|
|
|
|
foreach ( $expected as $name => $value ) {
|
|
$this->assertArrayHasKey( $name, $veConfig );
|
|
$this->assertSame( $value, $veConfig[$name] );
|
|
}
|
|
}
|
|
|
|
public static function provideOnResourceLoaderGetConfigVars() {
|
|
yield [ [], [] ];
|
|
// TODO: test a lot more config!
|
|
}
|
|
|
|
}
|