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 +++++++++++++++- tests/mocks/ci_testconfig.php | 8 ++++---- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'tests') 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 = <<config[$key]) ? $this->config[$key] : FALSE; } - public function load($file, $arg2 = FALSE, $arg3 = FALSE) + public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { $this->loaded[] = $file; return TRUE; } -} \ No newline at end of file +} -- cgit v1.2.3-24-g4f1b