Use setTemporaryHook() in SkinVectorTest
The MediaWikiIntegrationTestCase::setTemporaryHook() function was recently updated in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/622400 to work with the new hook system. Use the new function in Vector tests, as some extensions that use the new Hooks system are failing to pass the Vector tests that run in their Jenkins CI tests (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/examples/+/603569). Bug: T254381 Change-Id: If8289b2bf47a35140e2fef72234ffad7aae37c90
This commit is contained in:
parent
76ee2c2813
commit
da158807b6
|
@ -53,23 +53,20 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase {
|
|||
$context->setTitle( $title );
|
||||
$context->setLanguage( 'fr' );
|
||||
$vectorTemplate = $this->provideVectorTemplateObject();
|
||||
|
||||
$this->setMwGlobals( 'wgHooks', [
|
||||
'PersonalUrls' => [
|
||||
function ( &$personal_urls, &$title, $skin ) {
|
||||
$personal_urls = [];
|
||||
}
|
||||
],
|
||||
'SkinTemplateNavigation' => [
|
||||
function ( &$skinTemplate, &$content_navigation ) {
|
||||
$content_navigation = [
|
||||
'actions' => [],
|
||||
'namespaces' => [],
|
||||
'variants' => [],
|
||||
'views' => [],
|
||||
];
|
||||
}
|
||||
]
|
||||
$this->setTemporaryHook( 'PersonalUrls', [
|
||||
function ( &$personal_urls, &$title, $skin ) {
|
||||
$personal_urls = [];
|
||||
}
|
||||
] );
|
||||
$this->setTemporaryHook( 'SkinTemplateNavigation', [
|
||||
function ( &$skinTemplate, &$content_navigation ) {
|
||||
$content_navigation = [
|
||||
'actions' => [],
|
||||
'namespaces' => [],
|
||||
'variants' => [],
|
||||
'views' => [],
|
||||
];
|
||||
}
|
||||
] );
|
||||
$openVectorTemplate = TestingAccessWrapper::newFromObject( $vectorTemplate );
|
||||
|
||||
|
@ -96,7 +93,7 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase {
|
|||
$actions = $props['data-page-actions-more'];
|
||||
$this->assertSame(
|
||||
'vector-menu-empty emptyPortlet vector-menu vector-menu-tabs vectorTabs',
|
||||
$namespaces['class']
|
||||
$namespaces['class']
|
||||
);
|
||||
$this->assertSame(
|
||||
'vector-menu-empty emptyPortlet vector-menu vector-menu-dropdown vectorMenu',
|
||||
|
|
Loading…
Reference in New Issue