summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core/Common_test.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-26 23:41:03 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-26 23:41:03 +0200
commit74ffd17ab06327ca62ddfe28a186cae7ba6bd459 (patch)
tree033c45ff09864b64807a92960f5ca546c4ecefbd /tests/codeigniter/core/Common_test.php
parenta779b2cf8ceaea5ecfd8d26f5e2c379b8fca48d8 (diff)
Deprecated form helper function form_prep().
This function has been broken for YEARS and it's value-caching logic has only introduced various problems. We have html_escape() since CI 2.1.0 which is a perfect replacement, so it should be used instead. Fixes #228 & #1630
Diffstat (limited to 'tests/codeigniter/core/Common_test.php')
-rw-r--r--tests/codeigniter/core/Common_test.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/codeigniter/core/Common_test.php b/tests/codeigniter/core/Common_test.php
index 27d48efc2..999b49cb3 100644
--- a/tests/codeigniter/core/Common_test.php
+++ b/tests/codeigniter/core/Common_test.php
@@ -2,8 +2,6 @@
class Common_test extends CI_TestCase {
- // ------------------------------------------------------------------------
-
public function test_is_php()
{
$this->assertEquals(TRUE, is_php('1.2.0'));
@@ -16,12 +14,12 @@ class Common_test extends CI_TestCase {
{
$this->assertEquals(' class="foo" id="bar"', _stringify_attributes(array('class' => 'foo', 'id' => 'bar')));
- $atts = new Stdclass;
+ $atts = new stdClass;
$atts->class = 'foo';
$atts->id = 'bar';
$this->assertEquals(' class="foo" id="bar"', _stringify_attributes($atts));
- $atts = new Stdclass;
+ $atts = new stdClass;
$this->assertEquals('', _stringify_attributes($atts));
$this->assertEquals(' class="foo" id="bar"', _stringify_attributes('class="foo" id="bar"'));
@@ -35,10 +33,20 @@ class Common_test extends CI_TestCase {
{
$this->assertEquals('width=800,height=600', _stringify_attributes(array('width' => '800', 'height' => '600'), TRUE));
- $atts = new Stdclass;
+ $atts = new stdClass;
$atts->width = 800;
$atts->height = 600;
$this->assertEquals('width=800,height=600', _stringify_attributes($atts, TRUE));
}
+ // ------------------------------------------------------------------------
+
+ public function test_html_escape()
+ {
+ $this->assertEquals(
+ html_escape('Here is a string containing "quoted" text.'),
+ 'Here is a string containing &quot;quoted&quot; text.'
+ );
+ }
+
} \ No newline at end of file