From c87f6a8b2ea46ac703b898004dfda88e67fdfbfa Mon Sep 17 00:00:00 2001 From: Jon Robson Date: Fri, 28 Jan 2022 15:59:19 -0800 Subject: [PATCH] Tests: Limit testGetTemplateData to current values to allow expansion In I0cd49e6d621cd437e440ac7f7627eaa064ab870c a new field will be added. Our tests in Vector shouldn't fail every time this happens Change-Id: Ieb4923e9f58f950ee02ce3eb1446b982d1f5724a --- tests/phpunit/integration/SkinVectorTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/phpunit/integration/SkinVectorTest.php b/tests/phpunit/integration/SkinVectorTest.php index 9f05d14a..da26d3a6 100644 --- a/tests/phpunit/integration/SkinVectorTest.php +++ b/tests/phpunit/integration/SkinVectorTest.php @@ -86,6 +86,18 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase { $views = $props['data-views']; $namespaces = $props['data-namespaces']; + // The mediawiki core specification might change at any time + // so let's limit the values we test to those we are aware of. + $keysToTest = [ + 'id', 'class', 'html-tooltip', 'html-items', + 'html-after-portal', 'html-before-portal', + 'label', 'heading-class', 'is-dropdown' + ]; + foreach ( $views as $key => $value ) { + if ( !in_array( $key, $keysToTest ) ) { + unset( $views[ $key] ); + } + } $this->assertSame( [ // Provided by core