summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter/helpers')
-rw-r--r--tests/codeigniter/helpers/date_helper_test.php20
-rw-r--r--tests/codeigniter/helpers/directory_helper_test.php4
-rw-r--r--tests/codeigniter/helpers/html_helper_test.php17
3 files changed, 29 insertions, 12 deletions
diff --git a/tests/codeigniter/helpers/date_helper_test.php b/tests/codeigniter/helpers/date_helper_test.php
index 4e01b1aa3..1b79b9480 100644
--- a/tests/codeigniter/helpers/date_helper_test.php
+++ b/tests/codeigniter/helpers/date_helper_test.php
@@ -69,7 +69,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_rfc822()
{
$this->assertEquals(
- date('D, d M y H:i:s O', $this->time),
+ date(DATE_RFC822, $this->time),
standard_date('DATE_RFC822', $this->time)
);
}
@@ -79,7 +79,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_atom()
{
$this->assertEquals(
- date("Y-m-d\TH:i:sO", $this->time),
+ date(DATE_ATOM, $this->time),
standard_date('DATE_ATOM', $this->time)
);
}
@@ -89,7 +89,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_cookie()
{
$this->assertEquals(
- date("l, d-M-y H:i:s \U\T\C", $this->time),
+ date(DATE_COOKIE, $this->time),
standard_date('DATE_COOKIE', $this->time)
);
}
@@ -99,7 +99,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_iso8601()
{
$this->assertEquals(
- date("Y-m-d\TH:i:sO", $this->time),
+ date(DATE_ISO8601, $this->time),
standard_date('DATE_ISO8601', $this->time)
);
}
@@ -109,7 +109,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_rfc850()
{
$this->assertEquals(
- date("l, d-M-y H:i:s \U\T\C", $this->time),
+ date(DATE_RFC850, $this->time),
standard_date('DATE_RFC850', $this->time)
);
}
@@ -119,7 +119,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_rfc1036()
{
$this->assertEquals(
- date('D, d M y H:i:s O', $this->time),
+ date(DATE_RFC1036, $this->time),
standard_date('DATE_RFC1036', $this->time)
);
}
@@ -129,7 +129,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_rfc1123()
{
$this->assertEquals(
- date('D, d M Y H:i:s O', $this->time),
+ date(DATE_RFC1123, $this->time),
standard_date('DATE_RFC1123', $this->time)
);
}
@@ -139,7 +139,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_rfc2822()
{
$this->assertEquals(
- date('D, d M Y H:i:s O', $this->time),
+ date(DATE_RFC2822, $this->time),
standard_date('DATE_RFC2822', $this->time)
);
}
@@ -149,7 +149,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_rss()
{
$this->assertEquals(
- date('D, d M Y H:i:s O', $this->time),
+ date(DATE_RSS, $this->time),
standard_date('DATE_RSS', $this->time)
);
}
@@ -159,7 +159,7 @@ class Date_helper_test extends CI_TestCase {
public function test_standard_date_w3c()
{
$this->assertEquals(
- date("Y-m-d\TH:i:sO", $this->time),
+ date(DATE_W3C, $this->time),
standard_date('DATE_W3C', $this->time)
);
}
diff --git a/tests/codeigniter/helpers/directory_helper_test.php b/tests/codeigniter/helpers/directory_helper_test.php
index 176ff1d78..c39ccd8d0 100644
--- a/tests/codeigniter/helpers/directory_helper_test.php
+++ b/tests/codeigniter/helpers/directory_helper_test.php
@@ -19,6 +19,7 @@ class Directory_helper_test extends CI_TestCase {
'benchmark.html' => '',
'database' => array('active_record.html' => '', 'binds.html' => ''),
'email.html' => '',
+ '0' => '',
'.hiddenfile.txt' => ''
)
);
@@ -30,7 +31,8 @@ class Directory_helper_test extends CI_TestCase {
'libraries' => array(
'benchmark.html',
'database' => array('active_record.html', 'binds.html'),
- 'email.html'
+ 'email.html',
+ '0'
)
);
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