diff --git a/lib/Newsletter/Renderer/Renderer.php b/lib/Newsletter/Renderer/Renderer.php index 3129eacc90..9c7d9d394e 100644 --- a/lib/Newsletter/Renderer/Renderer.php +++ b/lib/Newsletter/Renderer/Renderer.php @@ -167,7 +167,7 @@ class Renderer { * @return DomNode */ private function inlineCSSStyles($template) { - return $this->CSS_inliner->inlineCSS(null, $template); + return $this->CSS_inliner->inlineCSS($template); } /** diff --git a/lib/Util/CSS.php b/lib/Util/CSS.php index 80e5aded45..80549c0dfa 100644 --- a/lib/Util/CSS.php +++ b/lib/Util/CSS.php @@ -32,15 +32,11 @@ use MailPoet\Newsletter\Renderer\EscapeHelper as EHelper; */ class CSS { - /* - * The core of the algorithm, takes a URL and returns the HTML found there with the CSS inlined. - * If you pass $contents then the original HTML is not downloaded and $contents is used instead. - * $url is mandatory as it is used to resolve the links to the stylesheets found in the HTML. - */ /** + * @param string $contents * @return DomNode */ - function inlineCSS($url, $contents = null) { + function inlineCSS($contents) { $html = pQuery::parseStr($contents); if (!$html instanceof DomNode) { diff --git a/tests/unit/Util/CSSTest.php b/tests/unit/Util/CSSTest.php index b08801535d..b9d807c960 100644 --- a/tests/unit/Util/CSSTest.php +++ b/tests/unit/Util/CSSTest.php @@ -41,7 +41,7 @@ class CSSTest extends \MailPoetUnitTest { $styles = 'p { color: red; }'; $content = '
Foo
'; $html = $this->buildHtml($styles, $content); - $result_html = (string)$this->css->inlineCSS(null, $html); + $result_html = (string)$this->css->inlineCSS($html); $this->assertContains('', $result_html); } @@ -49,7 +49,7 @@ class CSSTest extends \MailPoetUnitTest { $styles = 'p { color: red; } .blue { color: blue; }'; $content = '
Foo
'; $html = $this->buildHtml($styles, $content); - $result_html = (string)$this->css->inlineCSS(null, $html); + $result_html = (string)$this->css->inlineCSS($html); $this->assertContains('', $result_html); } @@ -57,7 +57,7 @@ class CSSTest extends \MailPoetUnitTest { $styles = 'p { color: red; }'; $content = '
Foo
'; $html = $this->buildHtml($styles, $content); - $result_html = (string)$this->css->inlineCSS(null, $html); + $result_html = (string)$this->css->inlineCSS($html); $this->assertContains('', $result_html); } @@ -65,7 +65,7 @@ class CSSTest extends \MailPoetUnitTest { $styles = 'p { color: red !important; }'; $content = '
Foo
'; $html = $this->buildHtml($styles, $content); - $result_html = (string)$this->css->inlineCSS(null, $html); + $result_html = (string)$this->css->inlineCSS($html); $this->assertContains('', $result_html); }