2 // $Id: decorator_textual_test.php 4940 2012-06-06 02:20:28Z fishbone $
4 require_once('simple_include.php');
5 require_once('calendar_include.php');
7 require_once('./decorator_test.php');
9 class TestOfDecoratorTextual extends TestOfDecorator {
10 function TestOfDecoratorTextual() {
11 $this->UnitTestCase('Test of Calendar_Decorator_Textual');
13 function testMonthNamesLong() {
14 $Textual = new Calendar_Decorator_Textual($this->mockcal);
29 $this->assertEqual($monthNames,$Textual->monthNames());
31 function testMonthNamesShort() {
32 $Textual = new Calendar_Decorator_Textual($this->mockcal);
47 $this->assertEqual($monthNames,$Textual->monthNames('short'));
49 function testMonthNamesTwo() {
50 $Textual = new Calendar_Decorator_Textual($this->mockcal);
65 $this->assertEqual($monthNames,$Textual->monthNames('two'));
67 function testMonthNamesOne() {
68 $Textual = new Calendar_Decorator_Textual($this->mockcal);
83 $this->assertEqual($monthNames,$Textual->monthNames('one'));
85 function testWeekdayNamesLong() {
86 $Textual = new Calendar_Decorator_Textual($this->mockcal);
87 $weekdayNames = array(
96 $this->assertEqual($weekdayNames,$Textual->weekdayNames());
98 function testWeekdayNamesShort() {
99 $Textual = new Calendar_Decorator_Textual($this->mockcal);
100 $weekdayNames = array(
109 $this->assertEqual($weekdayNames,$Textual->weekdayNames('short'));
111 function testWeekdayNamesTwo() {
112 $Textual = new Calendar_Decorator_Textual($this->mockcal);
113 $weekdayNames = array(
122 $this->assertEqual($weekdayNames,$Textual->weekdayNames('two'));
124 function testWeekdayNamesOne() {
125 $Textual = new Calendar_Decorator_Textual($this->mockcal);
126 $weekdayNames = array(
135 $this->assertEqual($weekdayNames,$Textual->weekdayNames('one'));
137 function testPrevMonthNameShort() {
138 $Textual = new Calendar_Decorator_Textual($this->mockcal);
139 $this->assertEqual('Sep',$Textual->prevMonthName('short'));
141 function testThisMonthNameShort() {
142 $Textual = new Calendar_Decorator_Textual($this->mockcal);
143 $this->assertEqual('Oct',$Textual->thisMonthName('short'));
145 function testNextMonthNameShort() {
146 $Textual = new Calendar_Decorator_Textual($this->mockcal);
147 $this->assertEqual('Nov',$Textual->nextMonthName('short'));
149 function testThisDayNameShort() {
150 $Textual = new Calendar_Decorator_Textual($this->mockcal);
151 $this->assertEqual('Wed',$Textual->thisDayName('short'));
153 function testOrderedWeekdaysShort() {
154 $weekdayNames = array(
163 $nShifts = CALENDAR_FIRST_DAY_OF_WEEK;
164 while ($nShifts-- > 0) {
165 $day = array_shift($weekdayNames);
166 array_push($weekdayNames, $day);
168 $Textual = new Calendar_Decorator_Textual($this->mockcal);
169 $this->assertEqual($weekdayNames,$Textual->orderedWeekdays('short'));
174 if (!defined('TEST_RUNNING')) {
175 define('TEST_RUNNING', true);
176 $test = &new TestOfDecoratorTextual();
177 $test->run(new HtmlReporter());