summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/helpers/array_helper_test.php (renamed from tests/codeigniter/helpers/Array_helper_test.php)0
-rw-r--r--tests/codeigniter/helpers/html_helper_test.php67
2 files changed, 67 insertions, 0 deletions
diff --git a/tests/codeigniter/helpers/Array_helper_test.php b/tests/codeigniter/helpers/array_helper_test.php
index bbefdb49d..bbefdb49d 100644
--- a/tests/codeigniter/helpers/Array_helper_test.php
+++ b/tests/codeigniter/helpers/array_helper_test.php
diff --git a/tests/codeigniter/helpers/html_helper_test.php b/tests/codeigniter/helpers/html_helper_test.php
new file mode 100644
index 000000000..3b7f2b342
--- /dev/null
+++ b/tests/codeigniter/helpers/html_helper_test.php
@@ -0,0 +1,67 @@
+<?php
+
+require_once(BASEPATH.'helpers/html_helper.php');
+
+class Html_helper_test extends PHPUnit_Framework_TestCase
+{
+ public function testHeading()
+ {
+ $this->assertEquals('<h1>foobar</h1>', heading('foobar'));
+ }
+
+ // ------------------------------------------------------------------------
+
+ public function testUl()
+ {
+ $expect = <<<EOH
+<ul>
+ <li>foo</li>
+ <li>bar</li>
+</ul>
+
+EOH;
+
+ $expect = ltrim($expect);
+
+ $list = array('foo', 'bar');
+
+ $this->assertEquals($expect, ul($list));
+
+
+ $expect = <<<EOH
+<ul class="test">
+ <li>foo</li>
+ <li>bar</li>
+</ul>
+
+EOH;
+
+ $expect = ltrim($expect);
+
+ $list = array('foo', 'bar');
+
+ $this->assertEquals($expect, ul($list, ' class="test"'));
+
+ $this->assertEquals($expect, ul($list, array('class' => 'test')));
+ }
+
+ // ------------------------------------------------------------------------
+
+ public function testNBS()
+ {
+ $this->assertEquals('&nbsp;&nbsp;&nbsp;', nbs(3));
+ }
+
+ // ------------------------------------------------------------------------
+
+ public function testMeta()
+ {
+ $this->assertEquals("<meta name=\"test\" content=\"foo\" />\n", meta('test', 'foo'));
+
+ $expect = "<meta name=\"foo\" content=\"\" />\n";
+
+ $this->assertEquals($expect, meta(array('name' => 'foo')));
+
+ }
+
+} \ No newline at end of file