mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding tests and fixing inline parameter being converted to an attribute.
Fixes #265
This commit is contained in:
parent
8803f7d62d
commit
e776cf1ad2
2 changed files with 9 additions and 3 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue