Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding tests and fixing inline parameter being converted to an attrib…

…ute.

Fixes #265
  • Loading branch information...
commit e776cf1ad28ad74bf05d42ea61184cfe9612307a 1 parent 8803f7d
@markstory markstory authored
View
2  cake/libs/view/helpers/html.php
@@ -407,7 +407,7 @@ function css($path, $rel = null, $options = array()) {
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);
View
10 cake/tests/cases/libs/view/helpers/html.test.php
@@ -421,12 +421,18 @@ function testCssLink() {
$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);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.