From 88023e065ed2f057ca1f6dab8a2005ca56a92272 Mon Sep 17 00:00:00 2001 From: jperras Date: Wed, 4 Nov 2009 19:03:29 -0500 Subject: [PATCH 1/2] Adding empty folder structure to app/views/elements for email/{html,text}. Implements #261. --- app/views/elements/email/html/empty | 0 app/views/elements/email/text/empty | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/views/elements/email/html/empty create mode 100644 app/views/elements/email/text/empty diff --git a/app/views/elements/email/html/empty b/app/views/elements/email/html/empty new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/elements/email/text/empty b/app/views/elements/email/text/empty new file mode 100644 index 000000000..e69de29bb From e776cf1ad28ad74bf05d42ea61184cfe9612307a Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 5 Nov 2009 23:32:39 -0500 Subject: [PATCH 2/2] Adding tests and fixing inline parameter being converted to an attribute. Fixes #265 --- cake/libs/view/helpers/html.php | 2 +- cake/tests/cases/libs/view/helpers/html.test.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) 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); } /**