@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | // $Id: all_tests.php 1511 2011-09-01 20:56:07Z jjdai $ |
3 | 3 | |
4 | -require_once __DIR__ . '/simple_include.php'; |
|
5 | -require_once __DIR__ . '/calendar_include.php'; |
|
4 | +require_once __DIR__.'/simple_include.php'; |
|
5 | +require_once __DIR__.'/calendar_include.php'; |
|
6 | 6 | |
7 | 7 | define('TEST_RUNNING', true); |
8 | 8 | |
9 | -require_once __DIR__ . '/calendar_tests.php'; |
|
10 | -require_once __DIR__ . '/calendar_tabular_tests.php'; |
|
11 | -require_once __DIR__ . '/validator_tests.php'; |
|
12 | -require_once __DIR__ . '/calendar_engine_tests.php'; |
|
13 | -require_once __DIR__ . '/calendar_engine_tests.php'; |
|
14 | -require_once __DIR__ . '/table_helper_tests.php'; |
|
15 | -require_once __DIR__ . '/decorator_tests.php'; |
|
16 | -require_once __DIR__ . '/util_tests.php'; |
|
9 | +require_once __DIR__.'/calendar_tests.php'; |
|
10 | +require_once __DIR__.'/calendar_tabular_tests.php'; |
|
11 | +require_once __DIR__.'/validator_tests.php'; |
|
12 | +require_once __DIR__.'/calendar_engine_tests.php'; |
|
13 | +require_once __DIR__.'/calendar_engine_tests.php'; |
|
14 | +require_once __DIR__.'/table_helper_tests.php'; |
|
15 | +require_once __DIR__.'/decorator_tests.php'; |
|
16 | +require_once __DIR__.'/util_tests.php'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Class AllTests |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | public function testPrevMonth_Array() |
43 | 43 | { |
44 | 44 | $this->assertEqual(array( |
45 | - 'year' => 2002, |
|
46 | - 'month' => 12, |
|
47 | - 'day' => 1, |
|
48 | - 'hour' => 0, |
|
49 | - 'minute' => 0, |
|
50 | - 'second' => 0), $this->cal->prevMonth('array')); |
|
45 | + 'year' => 2002, |
|
46 | + 'month' => 12, |
|
47 | + 'day' => 1, |
|
48 | + 'hour' => 0, |
|
49 | + 'minute' => 0, |
|
50 | + 'second' => 0), $this->cal->prevMonth('array')); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function testThisMonth() |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | public function testPrevDay_Array() |
69 | 69 | { |
70 | 70 | $this->assertEqual(array( |
71 | - 'year' => 2002, |
|
72 | - 'month' => 12, |
|
73 | - 'day' => 31, |
|
74 | - 'hour' => 0, |
|
75 | - 'minute' => 0, |
|
76 | - 'second' => 0), $this->cal->prevDay('array')); |
|
71 | + 'year' => 2002, |
|
72 | + 'month' => 12, |
|
73 | + 'day' => 31, |
|
74 | + 'hour' => 0, |
|
75 | + 'minute' => 0, |
|
76 | + 'second' => 0), $this->cal->prevDay('array')); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | public function testThisDay() |
@@ -181,7 +181,7 @@ |
||
181 | 181 | |
182 | 182 | public function testSelection() |
183 | 183 | { |
184 | - require_once(CALENDAR_ROOT . 'Month.php'); |
|
184 | + require_once(CALENDAR_ROOT.'Month.php'); |
|
185 | 185 | $selection = array(new Calendar_Month(2003, 10)); |
186 | 186 | $this->cal->build($selection); |
187 | 187 | $i = 1; |
@@ -27,12 +27,12 @@ |
||
27 | 27 | public function testPrevDay_Array() |
28 | 28 | { |
29 | 29 | $this->assertEqual(array( |
30 | - 'year' => 2003, |
|
31 | - 'month' => 10, |
|
32 | - 'day' => 24, |
|
33 | - 'hour' => 0, |
|
34 | - 'minute' => 0, |
|
35 | - 'second' => 0), $this->cal->prevDay('array')); |
|
30 | + 'year' => 2003, |
|
31 | + 'month' => 10, |
|
32 | + 'day' => 24, |
|
33 | + 'hour' => 0, |
|
34 | + 'minute' => 0, |
|
35 | + 'second' => 0), $this->cal->prevDay('array')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function testPrevMinute() |
@@ -115,7 +115,7 @@ |
||
115 | 115 | |
116 | 116 | public function testSelection() |
117 | 117 | { |
118 | - require_once(CALENDAR_ROOT . 'Minute.php'); |
|
118 | + require_once(CALENDAR_ROOT.'Minute.php'); |
|
119 | 119 | $selection = array(new Calendar_Minute(2003, 10, 25, 13, 32)); |
120 | 120 | $this->cal->build($selection); |
121 | 121 | $i = 0; |
@@ -185,7 +185,7 @@ |
||
185 | 185 | 4 => 'Thu', |
186 | 186 | 5 => 'Fri', |
187 | 187 | 6 => 'Sat'); |
188 | - $nShifts = CALENDAR_FIRST_DAY_OF_WEEK; |
|
188 | + $nShifts = CALENDAR_FIRST_DAY_OF_WEEK; |
|
189 | 189 | while ($nShifts-- > 0) { |
190 | 190 | $day = array_shift($weekdayNames); |
191 | 191 | array_push($weekdayNames, $day); |
@@ -207,7 +207,7 @@ |
||
207 | 207 | 4 => 'Thu', |
208 | 208 | 5 => 'Fri', |
209 | 209 | 6 => 'Sat'); |
210 | - $nShifts = CALENDAR_FIRST_DAY_OF_WEEK; |
|
210 | + $nShifts = CALENDAR_FIRST_DAY_OF_WEEK; |
|
211 | 211 | while ($nShifts-- > 0) { |
212 | 212 | $day = array_shift($weekdayNames); |
213 | 213 | array_push($weekdayNames, $day); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | if (!$engine) { |
99 | 99 | if (!class_exists($class)) { |
100 | - include_once CALENDAR_ROOT . 'Engine' . '/' . CALENDAR_ENGINE . '.php'; |
|
100 | + include_once CALENDAR_ROOT.'Engine'.'/'.CALENDAR_ENGINE.'.php'; |
|
101 | 101 | } |
102 | 102 | $engine = new $class; |
103 | 103 | } |
@@ -211,12 +211,12 @@ discard block |
||
211 | 211 | $cE = Calendar_Engine_Factory::getEngine(); |
212 | 212 | } |
213 | 213 | $this->cE = &$cE; |
214 | - $this->year = (int)$y; |
|
215 | - $this->month = (int)$m; |
|
216 | - $this->day = (int)$d; |
|
217 | - $this->hour = (int)$h; |
|
218 | - $this->minute = (int)$i; |
|
219 | - $this->second = (int)$s; |
|
214 | + $this->year = (int) $y; |
|
215 | + $this->month = (int) $m; |
|
216 | + $this->day = (int) $d; |
|
217 | + $this->hour = (int) $h; |
|
218 | + $this->minute = (int) $i; |
|
219 | + $this->second = (int) $s; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | return $this->toArray($stamp); |
346 | 346 | break; |
347 | 347 | case 'object': |
348 | - include_once CALENDAR_ROOT . 'Factory.php'; |
|
348 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
349 | 349 | |
350 | 350 | return Calendar_Factory::createByTimestamp($returnType, $stamp); |
351 | 351 | break; |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | public function & getValidator() |
458 | 458 | { |
459 | 459 | if (!isset($this->validator)) { |
460 | - include_once CALENDAR_ROOT . 'Validator.php'; |
|
460 | + include_once CALENDAR_ROOT.'Validator.php'; |
|
461 | 461 | $this->validator = new Calendar_Validator($this); |
462 | 462 | } |
463 | 463 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | { |
493 | 493 | if (defined('CALENDAR_FIRST_DAY_OF_WEEK')) { |
494 | 494 | if (($firstDay != CALENDAR_FIRST_DAY_OF_WEEK) && !is_null($firstDay)) { |
495 | - $msg = 'CALENDAR_FIRST_DAY_OF_WEEK constant already defined.' . ' The $firstDay parameter will be ignored.'; |
|
495 | + $msg = 'CALENDAR_FIRST_DAY_OF_WEEK constant already defined.'.' The $firstDay parameter will be ignored.'; |
|
496 | 496 | trigger_error($msg, E_USER_WARNING); |
497 | 497 | } |
498 | 498 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT . 'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT.'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Represents a Second<br /> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT . 'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT.'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Represents a Year and builds Months<br> |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function build($sDates = array(), $firstDay = null) |
106 | 106 | { |
107 | - include_once CALENDAR_ROOT . 'Factory.php'; |
|
107 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
108 | 108 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
109 | 109 | $monthsInYear = $this->cE->getMonthsInYear($this->thisYear()); |
110 | 110 | for ($i = 1; $i <= $monthsInYear; ++$i) { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Load Calendar base class |
50 | 50 | */ |
51 | -require_once CALENDAR_ROOT . 'Calendar.php'; |
|
51 | +require_once CALENDAR_ROOT.'Calendar.php'; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Represents a Week and builds Days in tabular format<br> |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function __construct($y, $m, $d, $firstDay = null) |
139 | 139 | { |
140 | - include_once CALENDAR_ROOT . 'Table/Helper.php'; |
|
140 | + include_once CALENDAR_ROOT.'Table/Helper.php'; |
|
141 | 141 | parent::__construct($y, $m, $d); |
142 | 142 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
143 | 143 | $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function build($sDates = array()) |
175 | 175 | { |
176 | - include_once CALENDAR_ROOT . 'Day.php'; |
|
176 | + include_once CALENDAR_ROOT.'Day.php'; |
|
177 | 177 | $year = $this->cE->stampToYear($this->thisWeek); |
178 | 178 | $month = $this->cE->stampToMonth($this->thisWeek); |
179 | 179 | $day = $this->cE->stampToDay($this->thisWeek); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | case 'array': |
307 | 307 | return $this->toArray($this->prevWeek); |
308 | 308 | case 'object': |
309 | - include_once CALENDAR_ROOT . 'Factory.php'; |
|
309 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
310 | 310 | |
311 | 311 | return Calendar_Factory::createByTimestamp('Week', $this->prevWeek); |
312 | 312 | case 'timestamp': |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | case 'array': |
342 | 342 | return $this->toArray($this->thisWeek); |
343 | 343 | case 'object': |
344 | - include_once CALENDAR_ROOT . 'Factory.php'; |
|
344 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
345 | 345 | |
346 | 346 | return Calendar_Factory::createByTimestamp('Week', $this->thisWeek); |
347 | 347 | case 'timestamp': |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | case 'array': |
370 | 370 | return $this->toArray($this->nextWeek); |
371 | 371 | case 'object': |
372 | - include_once CALENDAR_ROOT . 'Factory.php'; |
|
372 | + include_once CALENDAR_ROOT.'Factory.php'; |
|
373 | 373 | |
374 | 374 | return Calendar_Factory::createByTimestamp('Week', $this->nextWeek); |
375 | 375 | case 'timestamp': |