diff options
author | Greg Aker <greg.aker@ellislab.com> | 2011-04-21 22:19:37 +0200 |
---|---|---|
committer | Greg Aker <greg.aker@ellislab.com> | 2011-04-21 22:19:37 +0200 |
commit | b58aeaca9be4b342bb6d88138005fdc7138828b4 (patch) | |
tree | f986aefeec38cfb6938c93f90596c41631edd7ce /tests/codeigniter/helpers/html_helper_test.php | |
parent | 1d3021a26e3d542137ceddc6c0f4a08a4f80a096 (diff) | |
parent | 9512ab8a22ff14a3789cba6e5ace03aed4196e23 (diff) |
Branch merge
Diffstat (limited to 'tests/codeigniter/helpers/html_helper_test.php')
-rw-r--r-- | tests/codeigniter/helpers/html_helper_test.php | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/codeigniter/helpers/html_helper_test.php b/tests/codeigniter/helpers/html_helper_test.php new file mode 100644 index 000000000..8c0e53301 --- /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 CI_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(' ', 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 |