summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers/date_helper_test.php
diff options
context:
space:
mode:
authordchill42 <dchill42@gmail.com>2012-10-10 14:16:39 +0200
committerdchill42 <dchill42@gmail.com>2012-10-10 14:16:39 +0200
commit2716398bd2f2ae36d7420c591fc759e0951ba0e2 (patch)
tree3845d6bacc5660559740a8eddd43210bbb14fefd /tests/codeigniter/helpers/date_helper_test.php
parenteeb6a480a4a25b7fe96e9ba0cf3aef273fd13c67 (diff)
parente8bc5f4450381b4f978f274f3e93604301115b64 (diff)
Merge branch 'develop' of github.com:/EllisLab/CodeIgniter into load_config_units
Diffstat (limited to 'tests/codeigniter/helpers/date_helper_test.php')
-rw-r--r--tests/codeigniter/helpers/date_helper_test.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/codeigniter/helpers/date_helper_test.php b/tests/codeigniter/helpers/date_helper_test.php
index 1b79b9480..9feade71c 100644
--- a/tests/codeigniter/helpers/date_helper_test.php
+++ b/tests/codeigniter/helpers/date_helper_test.php
@@ -290,6 +290,29 @@ class Date_helper_test extends CI_TestCase {
$this->assertEquals(0, timezones('non_existant'));
}
+ // ------------------------------------------------------------------------
+
+ public function test_date_range()
+ {
+ $dates = array(
+ '29-01-2012', '30-01-2012', '31-01-2012',
+ '01-02-2012', '02-02-2012', '03-02-2012',
+ '04-02-2012', '05-02-2012', '06-02-2012',
+ '07-02-2012', '08-02-2012', '09-02-2012',
+ '10-02-2012', '11-02-2012', '12-02-2012',
+ '13-02-2012', '14-02-2012', '15-02-2012',
+ '16-02-2012', '17-02-2012', '18-02-2012',
+ '19-02-2012', '20-02-2012', '21-02-2012',
+ '22-02-2012', '23-02-2012', '24-02-2012',
+ '25-02-2012', '26-02-2012', '27-02-2012',
+ '28-02-2012', '29-02-2012', '01-03-2012'
+ );
+
+ $this->assertEquals($dates, date_range(mktime(12, 0, 0, 1, 29, 2012), mktime(12, 0, 0, 3, 1, 2012), TRUE, 'd-m-Y'));
+ array_pop($dates);
+ $this->assertEquals($dates, date_range(mktime(12, 0, 0, 1, 29, 2012), 31, FALSE, 'd-m-Y'));
+ }
+
}
/* End of file date_helper_test.php */ \ No newline at end of file