From 828d31625c121cfb584c98ebe30ab20eb8769547 Mon Sep 17 00:00:00 2001 From: Paladox Date: Sat, 17 Sep 2016 22:02:05 +0000 Subject: [PATCH] Fix tests Change-Id: I761c8eea6c0ecc55f02ce86259c5afc83d6a96a9 --- includes/CookieWarning.hooks.php | 3 +++ tests/phpunit/includes/CookieWarning.hooksTest.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/CookieWarning.hooks.php b/includes/CookieWarning.hooks.php index 8e4758c..eb6350c 100644 --- a/includes/CookieWarning.hooks.php +++ b/includes/CookieWarning.hooks.php @@ -57,6 +57,9 @@ class CookieWarningHooks { ); } + if ( !isset( $tpl->data['headelement'] ) ) { + $tpl->data['headelement'] = ''; + } $tpl->data['headelement'] .= Html::openElement( 'div', array( 'class' => 'mw-cookiewarning-container' ) diff --git a/tests/phpunit/includes/CookieWarning.hooksTest.php b/tests/phpunit/includes/CookieWarning.hooksTest.php index a5c3095..9c30103 100644 --- a/tests/phpunit/includes/CookieWarning.hooksTest.php +++ b/tests/phpunit/includes/CookieWarning.hooksTest.php @@ -43,7 +43,7 @@ class CookieWarningHooksTest extends MediaWikiLangTestCase { // @codingStandardsIgnoreStart Generic.Files.LineLength $expected = str_replace( '$1', $expectedLink, - '
Cookies help us deliver our services. By using our services, you agree to our use of cookies.$1OK
' ); + '
Cookies help us deliver our services. By using our services, you agree to our use of cookies.$1
' ); // @codingStandardsIgnoreEnd } $this->assertEquals( $expected, $headElement ); @@ -121,4 +121,4 @@ class CookieWarningTestTemplate extends BaseTemplate { public function execute() { return; } -} \ No newline at end of file +}