コード例 #1
0
ファイル: PicoraCalendar.php プロジェクト: r8-forks/Picora
 public function isWeekday()
 {
     return !($this->getDayName() == PicoraCalendar::dayNameFromNumber(7) || $this->getDayName() == PicoraCalendar::dayNameFromNumber(1));
 }
コード例 #2
0
ファイル: test.php プロジェクト: r8-forks/Picora
 public function testCalenader()
 {
     $c = new PicoraCalendar(5, 2007);
     $may_2007_output = $c->display();
     $this->assertEqual(5, substr_count($may_2007_output, '<tr class="calendar_week">'));
     $this->assertEqual(1, substr_count($may_2007_output, '<tr class="calendar_header"><td colspan="7">'));
     $this->assertEqual(1, substr_count($may_2007_output, '<tr class="calendar_day_names">'));
     $c = new PicoraCalendar(5, 2007, array('header' => false, 'day_names' => false));
     $may_2007_output = $c->display();
     $this->assertEqual(5, substr_count($may_2007_output, '<tr class="calendar_week">'));
     $this->assertEqual(0, substr_count($may_2007_output, '<tr class="calendar_header"><td colspan="7">'));
     $this->assertEqual(0, substr_count($may_2007_output, '<tr class="calendar_day_names">'));
     $c = new PicoraCalendar(2, 2009, array('header' => false, 'day_names' => false));
     $feb_2009_output = $c->display();
     $this->assertEqual(4, substr_count($feb_2009_output, '<tr class="calendar_week">'));
     $this->assertEqual(0, substr_count($feb_2009_output, '<tr class="calendar_header"><td colspan="7">'));
     $this->assertEqual(0, substr_count($feb_2009_output, '<tr class="calendar_day_names">'));
 }