diff options
author | Eric Barnes <eric@ericlbarnes.com> | 2012-07-29 19:17:50 +0200 |
---|---|---|
committer | Eric Barnes <eric@ericlbarnes.com> | 2012-07-29 19:17:50 +0200 |
commit | b01b4f5507523155a598d4ee03d2709a275e88cf (patch) | |
tree | cfe86860d3af5ead77bacda9794a4aad7f8925f1 /tests/codeigniter/helpers/html_helper_test.php | |
parent | d83e727d6deedded5b637e685accb4fac0dc3985 (diff) | |
parent | 49d2f304d4bb9c04c41c34f4675813b9d8ac3204 (diff) |
Merge pull request #1669 from EllisLab/feature/stringify_attributes
Feature/stringify attributes
Diffstat (limited to 'tests/codeigniter/helpers/html_helper_test.php')
-rw-r--r-- | tests/codeigniter/helpers/html_helper_test.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/codeigniter/helpers/html_helper_test.php b/tests/codeigniter/helpers/html_helper_test.php index 9a7bb48bf..4dd717ff7 100644 --- a/tests/codeigniter/helpers/html_helper_test.php +++ b/tests/codeigniter/helpers/html_helper_test.php @@ -22,6 +22,22 @@ class Html_helper_test extends CI_TestCase { $this->assertEquals('<h2 class="bar">foobar</h2>', heading('foobar', 2, 'class="bar"')); } + public function test_heading_array_attributes() + { + // Test array of attributes + $this->assertEquals('<h2 class="bar" id="foo">foobar</h2>', heading('foobar', 2, array('class' => 'bar', 'id' => 'foo'))); + } + + public function test_heading_object_attributes() + { + // Test array of attributes + $this->assertEquals('<h2 class="bar" id="foo">foobar</h2>', heading('foobar', 2, array('class' => 'bar', 'id' => 'foo'))); + $test = new stdClass; + $test->class = "bar"; + $test->id = "foo"; + $this->assertEquals('<h2 class="bar" id="foo">foobar</h2>', heading('foobar', 2, $test)); + } + // ------------------------------------------------------------------------ public function test_Ul() @@ -72,5 +88,4 @@ EOH; $this->assertEquals($expect, meta(array('name' => 'foo'))); } - }
\ No newline at end of file |