Skip to content

Commit

Permalink
Adding tests and fixing inline parameter being converted to an attrib…
Browse files Browse the repository at this point in the history
…ute.

Fixes #265
  • Loading branch information
markstory committed Nov 6, 2009
1 parent 8803f7d commit e776cf1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cake/libs/view/helpers/html.php
Expand Up @@ -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);

Expand Down
10 changes: 8 additions & 2 deletions cake/tests/cases/libs/view/helpers/html.test.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit e776cf1

Please sign in to comment.