jenkins-bot has submitted this change and it was merged.

Change subject: Fix tests
......................................................................


Fix tests

Change-Id: I761c8eea6c0ecc55f02ce86259c5afc83d6a96a9
---
M includes/CookieWarning.hooks.php
M tests/phpunit/includes/CookieWarning.hooksTest.php
2 files changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



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 @@
                        );
                }
 
+               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 @@
                        // @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 @@
        public function execute() {
                return;
        }
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/311297
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I761c8eea6c0ecc55f02ce86259c5afc83d6a96a9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CookieWarning
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: JanZerebecki <jan.wikime...@zerebecki.de>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to