diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 08164d206..e02ea1e1a 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -407,7 +407,7 @@ class HtmlHelper extends AppHelper { if ($rel == null) { $rel = 'stylesheet'; } - $out = sprintf($this->tags['css'], $rel, $url, $this->_parseAttributes($options, null, '', ' ')); + $out = sprintf($this->tags['css'], $rel, $url, $this->_parseAttributes($options, array('inline'), '', ' ')); } $out = $this->output($out); diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index cd1b262b4..0318c50e1 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -421,12 +421,18 @@ class HtmlHelperTest extends CakeTestCase { $expected['link']['href'] = 'preg:/.*css\/vendor\.generic\.css/'; $this->assertTags($result[1], $expected); $this->assertEqual(count($result), 2); - - $view =& ClassRegistry::getObject('view'); + + ClassRegistry::removeObject('view'); $view =& new HtmlHelperMockView(); + ClassRegistry::addObject('view', $view); $view->expectAt(0, 'addScript', array(new PatternExpectation('/css_in_head.css/'))); $result = $this->Html->css('css_in_head', null, array('inline' => false)); $this->assertNull($result); + + $view =& ClassRegistry::getObject('view'); + $view->expectAt(1, 'addScript', array(new NoPatternExpectation('/inline=""/'))); + $result = $this->Html->css('more_css_in_head', null, array('inline' => false)); + $this->assertNull($result); } /**