Adding tests and fixing inline parameter being converted to an attribute.

Fixes #265
This commit is contained in:
mark_story 2009-11-05 23:32:39 -05:00
parent 8803f7d62d
commit e776cf1ad2
2 changed files with 9 additions and 3 deletions

View file

@ -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);

View file

@ -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);
}
/**