Fix tests

Change-Id: I761c8eea6c0ecc55f02ce86259c5afc83d6a96a9
This commit is contained in:
Paladox 2016-09-17 22:02:05 +00:00 committed by Florian Schmidt
parent b8686223e5
commit 828d31625c
2 changed files with 5 additions and 2 deletions

View file

@ -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' )

View file

@ -43,7 +43,7 @@ class CookieWarningHooksTest extends MediaWikiLangTestCase {
// @codingStandardsIgnoreStart Generic.Files.LineLength
$expected =
str_replace( '$1', $expectedLink,
'<div class="mw-cookiewarning-container"><div class="mw-cookiewarning-text"><span>Cookies help us deliver our services. By using our services, you agree to our use of cookies.</span>$1<a class="mw-cookiewarning-dismiss">OK</a></div></div>' );
'<div class="mw-cookiewarning-container"><div class="mw-cookiewarning-text"><span>Cookies help us deliver our services. By using our services, you agree to our use of cookies.</span>$1<form method="POST"><input name="disablecookiewarning" class="mw-cookiewarning-dismiss" type="submit" value="OK"/></form></div></div>' );
// @codingStandardsIgnoreEnd
}
$this->assertEquals( $expected, $headElement );
@ -121,4 +121,4 @@ class CookieWarningTestTemplate extends BaseTemplate {
public function execute() {
return;
}
}
}