From 0db02295502a54b5c1095faee244fb8fad3bfc9e Mon Sep 17 00:00:00 2001 From: Mateusz Rybarski Date: Wed, 28 Dec 2016 12:10:57 +0100 Subject: [PATCH] XW-2444: fixing tests --- services/PortableInfoboxRenderService.class.php | 9 +-------- templates/PortableInfoboxItemHeader.mustache | 3 +-- templates/PortableInfoboxItemTitle.mustache | 3 +-- tests/PortableInfoboxRenderServiceTest.php | 10 +++++----- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/services/PortableInfoboxRenderService.class.php b/services/PortableInfoboxRenderService.class.php index 51e8c25..82bf958 100644 --- a/services/PortableInfoboxRenderService.class.php +++ b/services/PortableInfoboxRenderService.class.php @@ -21,7 +21,7 @@ class PortableInfoboxRenderService extends WikiaService { * @param $layout * @return string - infobox HTML */ - public function renderInfobox( array $infoboxdata, $theme, $layout, $accentColor, $accentColorText ) { + public function renderInfobox( array $infoboxdata, $theme, $layout ) { wfProfileIn( __METHOD__ ); $helper = new PortableInfoboxRenderServiceHelper(); @@ -31,13 +31,6 @@ class PortableInfoboxRenderService extends WikiaService { $this->imagesWidth = $helper->isEuropaTheme() ? PortableInfoboxRenderServiceHelper::EUROPA_THUMBNAIL_WIDTH : PortableInfoboxRenderServiceHelper::DEFAULT_DESKTOP_THUMBNAIL_WIDTH; - $colors = [ - 'hasAccentColor' => !empty( $accentColor ), - 'hasAccentColorText' => !empty( $accentColorText), - 'accentColor' => $accentColor, - 'accentColorText' => $accentColorText, - ]; - foreach ( $infoboxdata as $item ) { $type = $item[ 'type' ]; diff --git a/templates/PortableInfoboxItemHeader.mustache b/templates/PortableInfoboxItemHeader.mustache index 10e3b89..044f4ca 100644 --- a/templates/PortableInfoboxItemHeader.mustache +++ b/templates/PortableInfoboxItemHeader.mustache @@ -1,2 +1 @@ -

{{{value}}}

+

{{{value}}}

diff --git a/templates/PortableInfoboxItemTitle.mustache b/templates/PortableInfoboxItemTitle.mustache index 05b35a5..0d35c85 100644 --- a/templates/PortableInfoboxItemTitle.mustache +++ b/templates/PortableInfoboxItemTitle.mustache @@ -2,5 +2,4 @@ This template is linked with of mercury/front/templates/main/components/infobox-builder-item-title.hbs Changing this template requires modifying the other in mercury repo. }} -

{{{value}}}

+

{{{value}}}

diff --git a/tests/PortableInfoboxRenderServiceTest.php b/tests/PortableInfoboxRenderServiceTest.php index 7acd654..e870f1e 100644 --- a/tests/PortableInfoboxRenderServiceTest.php +++ b/tests/PortableInfoboxRenderServiceTest.php @@ -66,7 +66,7 @@ class PortableInfoboxRenderServiceTest extends WikiaBaseTest { } ); $expected = $this->normalizeHTML( '' ); $result = $this->normalizeHTML( $output ); $this->assertEquals( $expected, $result ); @@ -107,7 +107,7 @@ class PortableInfoboxRenderServiceTest extends WikiaBaseTest { ] ], 'output' => '', 'description' => 'Only title' ], @@ -263,7 +263,7 @@ class PortableInfoboxRenderServiceTest extends WikiaBaseTest { ] ], 'output' => '