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