mediawiki-extensions-Visual.../tests/phpunit/integration/HooksTest.php
thiemowmde 2216426f61 Fix empty provider in HooksTest
This was not doing anything any more after I50b20ed.

Change-Id: I5af8f9cd2f6fb94b3bb007b72417dcb7a7f67ac9
2024-02-20 12:19:49 +00:00

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!
}
}