Get rid of unused argument in inlineCss
[MAILPOET-1891]
This commit is contained in:
committed by
M. Shull
parent
c2f5a98893
commit
bc32e5f6f3
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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) {
|
||||
|
@ -41,7 +41,7 @@ class CSSTest extends \MailPoetUnitTest {
|
||||
$styles = 'p { color: red; }';
|
||||
$content = '<p>Foo</p>';
|
||||
$html = $this->buildHtml($styles, $content);
|
||||
$result_html = (string)$this->css->inlineCSS(null, $html);
|
||||
$result_html = (string)$this->css->inlineCSS($html);
|
||||
$this->assertContains('<p style="color:red">', $result_html);
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ class CSSTest extends \MailPoetUnitTest {
|
||||
$styles = 'p { color: red; } .blue { color: blue; }';
|
||||
$content = '<p class="blue">Foo</p>';
|
||||
$html = $this->buildHtml($styles, $content);
|
||||
$result_html = (string)$this->css->inlineCSS(null, $html);
|
||||
$result_html = (string)$this->css->inlineCSS($html);
|
||||
$this->assertContains('<p class="blue" style="color:blue">', $result_html);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ class CSSTest extends \MailPoetUnitTest {
|
||||
$styles = 'p { color: red; }';
|
||||
$content = '<p style="color:green">Foo</p>';
|
||||
$html = $this->buildHtml($styles, $content);
|
||||
$result_html = (string)$this->css->inlineCSS(null, $html);
|
||||
$result_html = (string)$this->css->inlineCSS($html);
|
||||
$this->assertContains('<p style="color:green">', $result_html);
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ class CSSTest extends \MailPoetUnitTest {
|
||||
$styles = 'p { color: red !important; }';
|
||||
$content = '<p style="color:green !important">Foo</p>';
|
||||
$html = $this->buildHtml($styles, $content);
|
||||
$result_html = (string)$this->css->inlineCSS(null, $html);
|
||||
$result_html = (string)$this->css->inlineCSS($html);
|
||||
$this->assertContains('<p style="color:red">', $result_html);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user