From c576995304fc3609cca0b7b92d1b2cd611ec82f5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 16 Jan 2019 17:49:35 +0200 Subject: [ci skip] 3.1.10 release --- tests/codeigniter/libraries/Calendar_test.php | 222 -------------------------- 1 file changed, 222 deletions(-) delete mode 100644 tests/codeigniter/libraries/Calendar_test.php (limited to 'tests/codeigniter/libraries/Calendar_test.php') diff --git a/tests/codeigniter/libraries/Calendar_test.php b/tests/codeigniter/libraries/Calendar_test.php deleted file mode 100644 index ad1f45e8c..000000000 --- a/tests/codeigniter/libraries/Calendar_test.php +++ /dev/null @@ -1,222 +0,0 @@ -ci_instance_var('load', $this->getMockBuilder('CI_Loader')->setMethods(array('helper'))->getMock()); - - $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load', 'line'))->getMock(); - $lang->expects($this->any())->method('line')->will($this->returnValue(FALSE)); - $this->ci_instance_var('lang', $lang); - - $this->calendar = new CI_Calendar(); - } - - // -------------------------------------------------------------------- - - public function test_initialize() - { - $this->calendar->initialize(array( - 'month_type' => 'short', - 'start_day' => 'monday' - )); - $this->assertEquals('short', $this->calendar->month_type); - $this->assertEquals('monday', $this->calendar->start_day); - } - - // -------------------------------------------------------------------- - - public function test_generate() - { - $no_events = ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
September 2011
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
252627282930 
'; - - $this->assertEquals($no_events, $this->calendar->generate(2011, 9)); - - $data = array( - 3 => 'http://example.com/news/article/2006/03/', - 7 => 'http://example.com/news/article/2006/07/', - 13 => 'http://example.com/news/article/2006/13/', - 26 => 'http://example.com/news/article/2006/26/' - ); - - $events = ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
September 2011
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
252627282930 
'; - - $this->assertEquals($events, $this->calendar->generate(2011, 9, $data)); - } - - // -------------------------------------------------------------------- - - public function test_get_month_name() - { - $this->calendar->month_type = NULL; - $this->assertEquals('January', $this->calendar->get_month_name('01')); - - $this->calendar->month_type = 'short'; - $this->assertEquals('Jan', $this->calendar->get_month_name('01')); - } - - // -------------------------------------------------------------------- - - public function test_get_day_names() - { - $this->assertEquals(array( - 'Sunday', - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', - 'Saturday' - ), $this->calendar->get_day_names('long')); - - $this->assertEquals(array( - 'Sun', - 'Mon', - 'Tue', - 'Wed', - 'Thu', - 'Fri', - 'Sat' - ), $this->calendar->get_day_names('short')); - - $this->calendar->day_type = NULL; - - $this->assertEquals(array( - 'Su', - 'Mo', - 'Tu', - 'We', - 'Th', - 'Fr', - 'Sa' - ), $this->calendar->get_day_names()); - } - - // -------------------------------------------------------------------- - - public function test_adjust_date() - { - $this->assertEquals(array('month' => 8, 'year' => 2012), $this->calendar->adjust_date(8, 2012)); - $this->assertEquals(array('month' => 1, 'year' => 2013), $this->calendar->adjust_date(13, 2012)); - } - - // -------------------------------------------------------------------- - - public function test_get_total_days() - { - $this->assertEquals(0, $this->calendar->get_total_days(13, 2012)); - - $this->assertEquals(31, $this->calendar->get_total_days(1, 2012)); - $this->assertEquals(28, $this->calendar->get_total_days(2, 2011)); - $this->assertEquals(29, $this->calendar->get_total_days(2, 2012)); - $this->assertEquals(31, $this->calendar->get_total_days(3, 2012)); - $this->assertEquals(30, $this->calendar->get_total_days(4, 2012)); - $this->assertEquals(31, $this->calendar->get_total_days(5, 2012)); - $this->assertEquals(30, $this->calendar->get_total_days(6, 2012)); - $this->assertEquals(31, $this->calendar->get_total_days(7, 2012)); - $this->assertEquals(31, $this->calendar->get_total_days(8, 2012)); - $this->assertEquals(30, $this->calendar->get_total_days(9, 2012)); - $this->assertEquals(31, $this->calendar->get_total_days(10, 2012)); - $this->assertEquals(30, $this->calendar->get_total_days(11, 2012)); - $this->assertEquals(31, $this->calendar->get_total_days(12, 2012)); - } - - // -------------------------------------------------------------------- - - public function test_default_template() - { - $array = array( - 'table_open' => '', - 'heading_row_start' => '', - 'heading_previous_cell' => '', - 'heading_title_cell' => '', - 'heading_next_cell' => '', - 'heading_row_end' => '', - 'week_row_start' => '', - 'week_day_cell' => '', - 'week_row_end' => '', - 'cal_row_start' => '', - 'cal_cell_start' => '', - 'cal_cell_end_today' => '', - 'cal_row_end' => '', - 'table_close' => '
<<{heading}>>
{week_day}
', - 'cal_cell_start_today' => '', - 'cal_cell_content' => '{day}', - 'cal_cell_content_today' => '{day}', - 'cal_cell_no_content' => '{day}', - 'cal_cell_no_content_today' => '{day}', - 'cal_cell_blank' => ' ', - 'cal_cell_end' => '
', - 'cal_cell_start_other' => '', - 'cal_cell_other' => '{day}', - 'cal_cell_end_other' => '' - ); - - $this->assertEquals($array, $this->calendar->default_template()); - } - -} -- cgit v1.2.3-24-g4f1b