From 356bc66ebcd6a4d48c28fd119233e9d0bb12375f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 6 Mar 2017 14:39:28 +0200 Subject: Fix #5044; add unit tests for img() HTML helper --- tests/codeigniter/helpers/html_helper_test.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests/codeigniter/helpers/html_helper_test.php') diff --git a/tests/codeigniter/helpers/html_helper_test.php b/tests/codeigniter/helpers/html_helper_test.php index d66ad895c..3cf1016ec 100644 --- a/tests/codeigniter/helpers/html_helper_test.php +++ b/tests/codeigniter/helpers/html_helper_test.php @@ -40,6 +40,20 @@ class Html_helper_test extends CI_TestCase { // ------------------------------------------------------------------------ + public function test_img() + { + $this->ci_set_config('base_url', 'http://localhost/'); + $this->assertEquals('', img("test")); + $this->assertEquals('', img("data:foo/bar,baz")); + $this->assertEquals('', img("data://foo")); + $this->assertEquals('', img("//foo.bar/baz")); + $this->assertEquals('', img("http://foo.bar/baz")); + $this->assertEquals('', img("https://foo.bar/baz")); + $this->assertEquals('', img("ftp://foo.bar/baz")); + } + + // ------------------------------------------------------------------------ + public function test_Ul() { $expect = <<