Merge "Fix config overrides in SkinVectorTest."

This commit is contained in:
jenkins-bot 2022-07-18 20:42:33 +00:00 committed by Gerrit Code Review
commit 9cc22f9c7d

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Skins\Vector\Tests\Integration;
use Exception;
use HashConfig;
use MediaWiki\MediaWikiServices;
use MediaWiki\Skins\Vector\SkinVector22;
use MediaWiki\Skins\Vector\SkinVectorLegacy;
@ -121,10 +120,9 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase {
$tocData[ 'number-section-count' ] >= $config[ 'VectorTableOfContentsCollapseAtCount' ]
];
$expectedNestedTocData = array_merge( $nestedTocData, $expectedConfigData );
$context = RequestContext::getMain();
$buttonLabel = $context->msg( 'vector-toc-toggle-button-label',
$expectedNestedTocData[ 'array-sections' ][ 0 ][ 'line' ]
)->text();
// qqx output
$buttonLabel = '(vector-toc-toggle-button-label: A)';
$expectedNestedTocData[ 'array-sections' ][ 0 ][ 'vector-button-label' ] = $buttonLabel;
return [
@ -186,10 +184,8 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase {
array $config,
array $expected
) {
$this->setMwGlobals( [
'wgVectorTableOfContentsCollapseAtCount' => $config['VectorTableOfContentsCollapseAtCount'],
'wgVectorTableOfContentsBeginning' => $config['VectorTableOfContentsBeginning'],
] );
$this->overrideConfigValues( $config );
$this->setUserLang( 'qqx' );
$skinVector = new SkinVector22( [ 'name' => 'vector-2022' ] );
$openSkinVector = TestingAccessWrapper::newFromObject( $skinVector );
@ -440,12 +436,11 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase {
bool $shouldHideLanguages,
bool $expected
) {
$config = new HashConfig( array_merge( $requirements, [
$this->overrideConfigValues( array_merge( $requirements, [
'DefaultSkin' => 'vector-2022',
'VectorDefaultSkinVersion' => '2',
'VectorSkinMigrationMode' => true,
] ) );
$this->installMockMwServices( $config );
$mockSkinVector = $this->getMockBuilder( SkinVector22::class )
->disableOriginalConstructor()