From 63217b7e10f719c5178dc4ff3144ae51ba79f1ba Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 19 Jun 2008 14:31:00 +0000 Subject: [PATCH] Fixing failing tests in core helper group, closes #4946 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7213 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/html.php | 2 ++ cake/tests/cases/libs/view/helpers/html.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/xml.test.php | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index a899e0664..e104cf006 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -222,6 +222,8 @@ class HtmlHelper extends AppHelper { } elseif (isset($attributes['type']) && isset($types[$attributes['type']])) { $type = $types[$attributes['type']]; unset($attributes['type']); + } else { + $type = array(); } } elseif ($url !== null) { $inline = $url; diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index be1d1cc84..254042dd0 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -632,7 +632,7 @@ class HtmlHelperTest extends CakeTestCase { $result = $this->Html->meta('atom', array('controller' => 'posts', 'ext' => 'xml')); $this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.xml/', 'type' => 'application/atom+xml', 'title' => 'atom'))); - + $result = $this->Html->meta('non-existing'); $this->assertTags($result, array('Html->para('class-name'); + $result = $this->Html->para('class-name', ''); $this->assertTags($result, array('p' => array('class' => 'class-name'))); $result = $this->Html->para('class-name', 'text'); diff --git a/cake/tests/cases/libs/view/helpers/xml.test.php b/cake/tests/cases/libs/view/helpers/xml.test.php index 910e503d3..03831f680 100644 --- a/cake/tests/cases/libs/view/helpers/xml.test.php +++ b/cake/tests/cases/libs/view/helpers/xml.test.php @@ -81,6 +81,8 @@ class XmlHelperTest extends UnitTestCase { function setUp() { $this->Xml =& new XmlHelper(); $this->Xml->beforeRender(); + $manager =& XmlManager::getInstance(); + $manager->namespaces = array(); } /** * testAddNamespace method