@@ -17,17 +17,17 @@ discard block |
||
17 | 17 | } |
18 | 18 | function setUp() |
19 | 19 | { |
20 | - $this->cal = new Calendar_Month(2003,10); |
|
20 | + $this->cal = new Calendar_Month(2003, 10); |
|
21 | 21 | } |
22 | 22 | function testPrevMonth_Object() |
23 | 23 | { |
24 | 24 | $this->assertEqual(new Calendar_Month(2003, 9), $this->cal->prevMonth('object')); |
25 | 25 | } |
26 | - function testPrevDay () |
|
26 | + function testPrevDay() |
|
27 | 27 | { |
28 | - $this->assertEqual(30,$this->cal->prevDay()); |
|
28 | + $this->assertEqual(30, $this->cal->prevDay()); |
|
29 | 29 | } |
30 | - function testPrevDay_Array () |
|
30 | + function testPrevDay_Array() |
|
31 | 31 | { |
32 | 32 | $this->assertEqual( |
33 | 33 | array( |
@@ -39,54 +39,54 @@ discard block |
||
39 | 39 | 'second' => 0), |
40 | 40 | $this->cal->prevDay('array')); |
41 | 41 | } |
42 | - function testThisDay () |
|
42 | + function testThisDay() |
|
43 | 43 | { |
44 | - $this->assertEqual(1,$this->cal->thisDay()); |
|
44 | + $this->assertEqual(1, $this->cal->thisDay()); |
|
45 | 45 | } |
46 | - function testNextDay () |
|
46 | + function testNextDay() |
|
47 | 47 | { |
48 | - $this->assertEqual(2,$this->cal->nextDay()); |
|
48 | + $this->assertEqual(2, $this->cal->nextDay()); |
|
49 | 49 | } |
50 | - function testPrevHour () |
|
50 | + function testPrevHour() |
|
51 | 51 | { |
52 | - $this->assertEqual(23,$this->cal->prevHour()); |
|
52 | + $this->assertEqual(23, $this->cal->prevHour()); |
|
53 | 53 | } |
54 | - function testThisHour () |
|
54 | + function testThisHour() |
|
55 | 55 | { |
56 | - $this->assertEqual(0,$this->cal->thisHour()); |
|
56 | + $this->assertEqual(0, $this->cal->thisHour()); |
|
57 | 57 | } |
58 | - function testNextHour () |
|
58 | + function testNextHour() |
|
59 | 59 | { |
60 | - $this->assertEqual(1,$this->cal->nextHour()); |
|
60 | + $this->assertEqual(1, $this->cal->nextHour()); |
|
61 | 61 | } |
62 | - function testPrevMinute () |
|
62 | + function testPrevMinute() |
|
63 | 63 | { |
64 | - $this->assertEqual(59,$this->cal->prevMinute()); |
|
64 | + $this->assertEqual(59, $this->cal->prevMinute()); |
|
65 | 65 | } |
66 | - function testThisMinute () |
|
66 | + function testThisMinute() |
|
67 | 67 | { |
68 | - $this->assertEqual(0,$this->cal->thisMinute()); |
|
68 | + $this->assertEqual(0, $this->cal->thisMinute()); |
|
69 | 69 | } |
70 | - function testNextMinute () |
|
70 | + function testNextMinute() |
|
71 | 71 | { |
72 | - $this->assertEqual(1,$this->cal->nextMinute()); |
|
72 | + $this->assertEqual(1, $this->cal->nextMinute()); |
|
73 | 73 | } |
74 | - function testPrevSecond () |
|
74 | + function testPrevSecond() |
|
75 | 75 | { |
76 | - $this->assertEqual(59,$this->cal->prevSecond()); |
|
76 | + $this->assertEqual(59, $this->cal->prevSecond()); |
|
77 | 77 | } |
78 | - function testThisSecond () |
|
78 | + function testThisSecond() |
|
79 | 79 | { |
80 | - $this->assertEqual(0,$this->cal->thisSecond()); |
|
80 | + $this->assertEqual(0, $this->cal->thisSecond()); |
|
81 | 81 | } |
82 | - function testNextSecond () |
|
82 | + function testNextSecond() |
|
83 | 83 | { |
84 | - $this->assertEqual(1,$this->cal->nextSecond()); |
|
84 | + $this->assertEqual(1, $this->cal->nextSecond()); |
|
85 | 85 | } |
86 | 86 | function testGetTimeStamp() |
87 | 87 | { |
88 | - $stamp = mktime(0,0,0,10,1,2003); |
|
89 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
88 | + $stamp = mktime(0, 0, 0, 10, 1, 2003); |
|
89 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
@@ -102,36 +102,36 @@ discard block |
||
102 | 102 | function testSize() |
103 | 103 | { |
104 | 104 | $this->cal->build(); |
105 | - $this->assertEqual(31,$this->cal->size()); |
|
105 | + $this->assertEqual(31, $this->cal->size()); |
|
106 | 106 | } |
107 | 107 | function testFetch() |
108 | 108 | { |
109 | 109 | $this->cal->build(); |
110 | - $i=0; |
|
111 | - while ( $Child = $this->cal->fetch() ) { |
|
110 | + $i = 0; |
|
111 | + while ($Child = $this->cal->fetch()) { |
|
112 | 112 | ++$i; |
113 | 113 | } |
114 | - $this->assertEqual(31,$i); |
|
114 | + $this->assertEqual(31, $i); |
|
115 | 115 | } |
116 | 116 | function testFetchAll() |
117 | 117 | { |
118 | 118 | $this->cal->build(); |
119 | 119 | $children = array(); |
120 | 120 | $i = 1; |
121 | - while ( $Child = $this->cal->fetch() ) { |
|
122 | - $children[$i]=$Child; |
|
121 | + while ($Child = $this->cal->fetch()) { |
|
122 | + $children[$i] = $Child; |
|
123 | 123 | ++$i; |
124 | 124 | } |
125 | - $this->assertEqual($children,$this->cal->fetchAll()); |
|
125 | + $this->assertEqual($children, $this->cal->fetchAll()); |
|
126 | 126 | } |
127 | 127 | function testSelection() |
128 | 128 | { |
129 | 129 | require_once(CALENDAR_ROOT . 'Day.php'); |
130 | - $selection = array(new Calendar_Day(2003,10,25)); |
|
130 | + $selection = array(new Calendar_Day(2003, 10, 25)); |
|
131 | 131 | $this->cal->build($selection); |
132 | 132 | $i = 1; |
133 | - while ( $Child = $this->cal->fetch() ) { |
|
134 | - if ( $i == 25 ) |
|
133 | + while ($Child = $this->cal->fetch()) { |
|
134 | + if ($i == 25) |
|
135 | 135 | break; |
136 | 136 | ++$i; |
137 | 137 | } |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | { |
20 | 20 | $this->cal = new Calendar_Month_Weeks(2003, 10); |
21 | 21 | } |
22 | - function testPrevDay () |
|
22 | + function testPrevDay() |
|
23 | 23 | { |
24 | 24 | $this->assertEqual(30, $this->cal->prevDay()); |
25 | 25 | } |
26 | - function testPrevDay_Array () |
|
26 | + function testPrevDay_Array() |
|
27 | 27 | { |
28 | 28 | $this->assertEqual( |
29 | 29 | array( |
@@ -35,54 +35,54 @@ discard block |
||
35 | 35 | 'second' => 0), |
36 | 36 | $this->cal->prevDay('array')); |
37 | 37 | } |
38 | - function testThisDay () |
|
38 | + function testThisDay() |
|
39 | 39 | { |
40 | 40 | $this->assertEqual(1, $this->cal->thisDay()); |
41 | 41 | } |
42 | - function testNextDay () |
|
42 | + function testNextDay() |
|
43 | 43 | { |
44 | 44 | $this->assertEqual(2, $this->cal->nextDay()); |
45 | 45 | } |
46 | - function testPrevHour () |
|
46 | + function testPrevHour() |
|
47 | 47 | { |
48 | 48 | $this->assertEqual(23, $this->cal->prevHour()); |
49 | 49 | } |
50 | - function testThisHour () |
|
50 | + function testThisHour() |
|
51 | 51 | { |
52 | 52 | $this->assertEqual(0, $this->cal->thisHour()); |
53 | 53 | } |
54 | - function testNextHour () |
|
54 | + function testNextHour() |
|
55 | 55 | { |
56 | 56 | $this->assertEqual(1, $this->cal->nextHour()); |
57 | 57 | } |
58 | - function testPrevMinute () |
|
58 | + function testPrevMinute() |
|
59 | 59 | { |
60 | 60 | $this->assertEqual(59, $this->cal->prevMinute()); |
61 | 61 | } |
62 | - function testThisMinute () |
|
62 | + function testThisMinute() |
|
63 | 63 | { |
64 | 64 | $this->assertEqual(0, $this->cal->thisMinute()); |
65 | 65 | } |
66 | - function testNextMinute () |
|
66 | + function testNextMinute() |
|
67 | 67 | { |
68 | 68 | $this->assertEqual(1, $this->cal->nextMinute()); |
69 | 69 | } |
70 | - function testPrevSecond () |
|
70 | + function testPrevSecond() |
|
71 | 71 | { |
72 | 72 | $this->assertEqual(59, $this->cal->prevSecond()); |
73 | 73 | } |
74 | - function testThisSecond () |
|
74 | + function testThisSecond() |
|
75 | 75 | { |
76 | 76 | $this->assertEqual(0, $this->cal->thisSecond()); |
77 | 77 | } |
78 | - function testNextSecond () |
|
78 | + function testNextSecond() |
|
79 | 79 | { |
80 | 80 | $this->assertEqual(1, $this->cal->nextSecond()); |
81 | 81 | } |
82 | 82 | function testGetTimeStamp() |
83 | 83 | { |
84 | - $stamp = mktime(0,0,0,10,1,2003); |
|
85 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
84 | + $stamp = mktime(0, 0, 0, 10, 1, 2003); |
|
85 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
@@ -98,17 +98,17 @@ discard block |
||
98 | 98 | function testSize() |
99 | 99 | { |
100 | 100 | $this->cal->build(); |
101 | - $this->assertEqual(5,$this->cal->size()); |
|
101 | + $this->assertEqual(5, $this->cal->size()); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | function testFetch() |
105 | 105 | { |
106 | 106 | $this->cal->build(); |
107 | - $i=0; |
|
107 | + $i = 0; |
|
108 | 108 | while ($Child = $this->cal->fetch()) { |
109 | 109 | ++$i; |
110 | 110 | } |
111 | - $this->assertEqual(5,$i); |
|
111 | + $this->assertEqual(5, $i); |
|
112 | 112 | } |
113 | 113 | /* Recusive dependency issue with SimpleTest |
114 | 114 | function testFetchAll() |
@@ -21,47 +21,47 @@ discard block |
||
21 | 21 | $this->cal = Calendar_Factory::create('Week', 2003, 10, 9); |
22 | 22 | //print_r($this->cal); |
23 | 23 | } |
24 | - function testThisYear () |
|
24 | + function testThisYear() |
|
25 | 25 | { |
26 | 26 | $this->assertEqual(2003, $this->cal->thisYear()); |
27 | 27 | |
28 | - $stamp = mktime(0,0,0,1,1,2003); |
|
28 | + $stamp = mktime(0, 0, 0, 1, 1, 2003); |
|
29 | 29 | $this->cal->setTimestamp($stamp); |
30 | 30 | $this->assertEqual(2003, $this->cal->thisYear()); |
31 | 31 | |
32 | - $stamp = mktime(0,0,0,12,31,2003); |
|
32 | + $stamp = mktime(0, 0, 0, 12, 31, 2003); |
|
33 | 33 | $this->cal->setTimestamp($stamp); |
34 | 34 | $this->assertEqual(2004, $this->cal->thisYear()); |
35 | 35 | |
36 | - $stamp = mktime(0,0,0,1,1,2005); |
|
36 | + $stamp = mktime(0, 0, 0, 1, 1, 2005); |
|
37 | 37 | $this->cal->setTimestamp($stamp); |
38 | 38 | $this->assertEqual(2004, $this->cal->thisYear()); |
39 | 39 | |
40 | - $stamp = mktime(0,0,0,12,31,2004); |
|
40 | + $stamp = mktime(0, 0, 0, 12, 31, 2004); |
|
41 | 41 | $this->cal->setTimestamp($stamp); |
42 | 42 | $this->assertEqual(2004, $this->cal->thisYear()); |
43 | 43 | |
44 | - $stamp = mktime(0,0,0,1,1,2005); |
|
44 | + $stamp = mktime(0, 0, 0, 1, 1, 2005); |
|
45 | 45 | $this->cal->setTimestamp($stamp); |
46 | 46 | $this->assertEqual(2004, $this->cal->thisYear()); |
47 | 47 | |
48 | - $stamp = mktime(0,0,0,12,31,2005); |
|
48 | + $stamp = mktime(0, 0, 0, 12, 31, 2005); |
|
49 | 49 | $this->cal->setTimestamp($stamp); |
50 | 50 | $this->assertEqual(2005, $this->cal->thisYear()); |
51 | 51 | |
52 | - $stamp = mktime(0,0,0,1,1,2006); |
|
52 | + $stamp = mktime(0, 0, 0, 1, 1, 2006); |
|
53 | 53 | $this->cal->setTimestamp($stamp); |
54 | 54 | $this->assertEqual(2005, $this->cal->thisYear()); |
55 | 55 | |
56 | - $stamp = mktime(0,0,0,12,31,2006); |
|
56 | + $stamp = mktime(0, 0, 0, 12, 31, 2006); |
|
57 | 57 | $this->cal->setTimestamp($stamp); |
58 | 58 | $this->assertEqual(2006, $this->cal->thisYear()); |
59 | 59 | } |
60 | - function testPrevDay () |
|
60 | + function testPrevDay() |
|
61 | 61 | { |
62 | 62 | $this->assertEqual(8, $this->cal->prevDay()); |
63 | 63 | } |
64 | - function testPrevDay_Array () |
|
64 | + function testPrevDay_Array() |
|
65 | 65 | { |
66 | 66 | $this->assertEqual( |
67 | 67 | array( |
@@ -73,58 +73,58 @@ discard block |
||
73 | 73 | 'second' => 0), |
74 | 74 | $this->cal->prevDay('array')); |
75 | 75 | } |
76 | - function testThisDay () |
|
76 | + function testThisDay() |
|
77 | 77 | { |
78 | 78 | $this->assertEqual(9, $this->cal->thisDay()); |
79 | 79 | } |
80 | - function testNextDay () |
|
80 | + function testNextDay() |
|
81 | 81 | { |
82 | 82 | $this->assertEqual(10, $this->cal->nextDay()); |
83 | 83 | } |
84 | - function testPrevHour () |
|
84 | + function testPrevHour() |
|
85 | 85 | { |
86 | 86 | $this->assertEqual(23, $this->cal->prevHour()); |
87 | 87 | } |
88 | - function testThisHour () |
|
88 | + function testThisHour() |
|
89 | 89 | { |
90 | 90 | $this->assertEqual(0, $this->cal->thisHour()); |
91 | 91 | } |
92 | - function testNextHour () |
|
92 | + function testNextHour() |
|
93 | 93 | { |
94 | 94 | $this->assertEqual(1, $this->cal->nextHour()); |
95 | 95 | } |
96 | - function testPrevMinute () |
|
96 | + function testPrevMinute() |
|
97 | 97 | { |
98 | 98 | $this->assertEqual(59, $this->cal->prevMinute()); |
99 | 99 | } |
100 | - function testThisMinute () |
|
100 | + function testThisMinute() |
|
101 | 101 | { |
102 | 102 | $this->assertEqual(0, $this->cal->thisMinute()); |
103 | 103 | } |
104 | - function testNextMinute () |
|
104 | + function testNextMinute() |
|
105 | 105 | { |
106 | 106 | $this->assertEqual(1, $this->cal->nextMinute()); |
107 | 107 | } |
108 | - function testPrevSecond () |
|
108 | + function testPrevSecond() |
|
109 | 109 | { |
110 | 110 | $this->assertEqual(59, $this->cal->prevSecond()); |
111 | 111 | } |
112 | - function testThisSecond () |
|
112 | + function testThisSecond() |
|
113 | 113 | { |
114 | 114 | $this->assertEqual(0, $this->cal->thisSecond()); |
115 | 115 | } |
116 | - function testNextSecond () |
|
116 | + function testNextSecond() |
|
117 | 117 | { |
118 | 118 | $this->assertEqual(1, $this->cal->nextSecond()); |
119 | 119 | } |
120 | 120 | function testGetTimeStamp() |
121 | 121 | { |
122 | - $stamp = mktime(0,0,0,10,9,2003); |
|
123 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
122 | + $stamp = mktime(0, 0, 0, 10, 9, 2003); |
|
123 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
124 | 124 | } |
125 | 125 | function testNewTimeStamp() |
126 | 126 | { |
127 | - $stamp = mktime(0,0,0,7,28,2004); |
|
127 | + $stamp = mktime(0, 0, 0, 7, 28, 2004); |
|
128 | 128 | $this->cal->setTimestamp($stamp); |
129 | 129 | $this->assertEqual('30 2004', date('W Y', $this->cal->prevWeek(true))); |
130 | 130 | $this->assertEqual('31 2004', date('W Y', $this->cal->thisWeek(true))); |
@@ -133,47 +133,47 @@ discard block |
||
133 | 133 | function testPrevWeekInMonth() |
134 | 134 | { |
135 | 135 | $this->assertEqual(1, $this->cal->prevWeek()); |
136 | - $stamp = mktime(0,0,0,2,3,2005); |
|
136 | + $stamp = mktime(0, 0, 0, 2, 3, 2005); |
|
137 | 137 | $this->cal->setTimestamp($stamp); |
138 | 138 | $this->assertEqual(0, $this->cal->prevWeek()); |
139 | 139 | } |
140 | 140 | function testThisWeekInMonth() |
141 | 141 | { |
142 | 142 | $this->assertEqual(2, $this->cal->thisWeek()); |
143 | - $stamp = mktime(0,0,0,2,3,2005); |
|
143 | + $stamp = mktime(0, 0, 0, 2, 3, 2005); |
|
144 | 144 | $this->cal->setTimestamp($stamp); |
145 | 145 | $this->assertEqual(1, $this->cal->thisWeek()); |
146 | - $stamp = mktime(0,0,0,1,1,2005); |
|
146 | + $stamp = mktime(0, 0, 0, 1, 1, 2005); |
|
147 | 147 | $this->cal->setTimestamp($stamp); |
148 | 148 | $this->assertEqual(1, $this->cal->thisWeek()); |
149 | - $stamp = mktime(0,0,0,1,3,2005); |
|
149 | + $stamp = mktime(0, 0, 0, 1, 3, 2005); |
|
150 | 150 | $this->cal->setTimestamp($stamp); |
151 | 151 | $this->assertEqual(2, $this->cal->thisWeek()); |
152 | 152 | } |
153 | 153 | function testNextWeekInMonth() |
154 | 154 | { |
155 | 155 | $this->assertEqual(3, $this->cal->nextWeek()); |
156 | - $stamp = mktime(0,0,0,2,3,2005); |
|
156 | + $stamp = mktime(0, 0, 0, 2, 3, 2005); |
|
157 | 157 | $this->cal->setTimestamp($stamp); |
158 | 158 | $this->assertEqual(2, $this->cal->nextWeek()); |
159 | 159 | } |
160 | 160 | function testPrevWeekInYear() |
161 | 161 | { |
162 | 162 | $this->assertEqual(date('W', $this->cal->prevWeek('timestamp')), $this->cal->prevWeek('n_in_year')); |
163 | - $stamp = mktime(0,0,0,1,1,2004); |
|
163 | + $stamp = mktime(0, 0, 0, 1, 1, 2004); |
|
164 | 164 | $this->cal->setTimestamp($stamp); |
165 | 165 | $this->assertEqual(date('W', $this->cal->nextWeek('timestamp')), $this->cal->nextWeek('n_in_year')); |
166 | 166 | } |
167 | 167 | function testThisWeekInYear() |
168 | 168 | { |
169 | 169 | $this->assertEqual(date('W', $this->cal->thisWeek('timestamp')), $this->cal->thisWeek('n_in_year')); |
170 | - $stamp = mktime(0,0,0,1,1,2004); |
|
170 | + $stamp = mktime(0, 0, 0, 1, 1, 2004); |
|
171 | 171 | $this->cal->setTimestamp($stamp); |
172 | 172 | $this->assertEqual(date('W', $this->cal->thisWeek('timestamp')), $this->cal->thisWeek('n_in_year')); |
173 | 173 | } |
174 | 174 | function testFirstWeekInYear() |
175 | 175 | { |
176 | - $stamp = mktime(0,0,0,1,4,2004); |
|
176 | + $stamp = mktime(0, 0, 0, 1, 4, 2004); |
|
177 | 177 | $this->cal->setTimestamp($stamp); |
178 | 178 | $this->assertEqual(1, $this->cal->thisWeek('n_in_year')); |
179 | 179 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | function testFetch() |
256 | 256 | { |
257 | 257 | $this->cal->build(); |
258 | - $i=0; |
|
258 | + $i = 0; |
|
259 | 259 | while ($Child = $this->cal->fetch()) { |
260 | 260 | ++$i; |
261 | 261 | } |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | $this->cal->build(); |
267 | 267 | $children = array(); |
268 | 268 | $i = 1; |
269 | - while ( $Child = $this->cal->fetch() ) { |
|
270 | - $children[$i]=$Child; |
|
269 | + while ($Child = $this->cal->fetch()) { |
|
270 | + $children[$i] = $Child; |
|
271 | 271 | ++$i; |
272 | 272 | } |
273 | - $this->assertEqual($children,$this->cal->fetchAll()); |
|
273 | + $this->assertEqual($children, $this->cal->fetchAll()); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | function testSelection() |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | require_once 'simple_include.php'; |
5 | 5 | require_once 'calendar_include.php'; |
6 | 6 | |
7 | -Mock::generate('Calendar_Engine_Interface','Mock_Calendar_Engine'); |
|
8 | -Mock::generate('Calendar_Second','Mock_Calendar_Second'); |
|
7 | +Mock::generate('Calendar_Engine_Interface', 'Mock_Calendar_Engine'); |
|
8 | +Mock::generate('Calendar_Second', 'Mock_Calendar_Second'); |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class TestOfTableHelper |
@@ -21,72 +21,72 @@ discard block |
||
21 | 21 | function setUp() |
22 | 22 | { |
23 | 23 | $this->mockengine = new Mock_Calendar_Engine($this); |
24 | - $this->mockengine->setReturnValue('getMinYears',1970); |
|
25 | - $this->mockengine->setReturnValue('getMaxYears',2037); |
|
26 | - $this->mockengine->setReturnValue('getMonthsInYear',12); |
|
27 | - $this->mockengine->setReturnValue('getDaysInMonth',31); |
|
28 | - $this->mockengine->setReturnValue('getHoursInDay',24); |
|
29 | - $this->mockengine->setReturnValue('getMinutesInHour',_EXTCAL_TS_MINUTE); |
|
30 | - $this->mockengine->setReturnValue('getSecondsInMinute',_EXTCAL_TS_MINUTE); |
|
31 | - $this->mockengine->setReturnValue('getWeekDays',array(0,1,2,3,4,5,6)); |
|
32 | - $this->mockengine->setReturnValue('getDaysInWeek',7); |
|
33 | - $this->mockengine->setReturnValue('getFirstDayOfWeek',1); |
|
34 | - $this->mockengine->setReturnValue('getFirstDayInMonth',3); |
|
24 | + $this->mockengine->setReturnValue('getMinYears', 1970); |
|
25 | + $this->mockengine->setReturnValue('getMaxYears', 2037); |
|
26 | + $this->mockengine->setReturnValue('getMonthsInYear', 12); |
|
27 | + $this->mockengine->setReturnValue('getDaysInMonth', 31); |
|
28 | + $this->mockengine->setReturnValue('getHoursInDay', 24); |
|
29 | + $this->mockengine->setReturnValue('getMinutesInHour', _EXTCAL_TS_MINUTE); |
|
30 | + $this->mockengine->setReturnValue('getSecondsInMinute', _EXTCAL_TS_MINUTE); |
|
31 | + $this->mockengine->setReturnValue('getWeekDays', array(0, 1, 2, 3, 4, 5, 6)); |
|
32 | + $this->mockengine->setReturnValue('getDaysInWeek', 7); |
|
33 | + $this->mockengine->setReturnValue('getFirstDayOfWeek', 1); |
|
34 | + $this->mockengine->setReturnValue('getFirstDayInMonth', 3); |
|
35 | 35 | $this->mockcal = new Mock_Calendar_Second($this); |
36 | - $this->mockcal->setReturnValue('thisYear',2003); |
|
37 | - $this->mockcal->setReturnValue('thisMonth',10); |
|
38 | - $this->mockcal->setReturnValue('thisDay',15); |
|
39 | - $this->mockcal->setReturnValue('thisHour',13); |
|
40 | - $this->mockcal->setReturnValue('thisMinute',30); |
|
41 | - $this->mockcal->setReturnValue('thisSecond',45); |
|
42 | - $this->mockcal->setReturnValue('getEngine',$this->mockengine); |
|
36 | + $this->mockcal->setReturnValue('thisYear', 2003); |
|
37 | + $this->mockcal->setReturnValue('thisMonth', 10); |
|
38 | + $this->mockcal->setReturnValue('thisDay', 15); |
|
39 | + $this->mockcal->setReturnValue('thisHour', 13); |
|
40 | + $this->mockcal->setReturnValue('thisMinute', 30); |
|
41 | + $this->mockcal->setReturnValue('thisSecond', 45); |
|
42 | + $this->mockcal->setReturnValue('getEngine', $this->mockengine); |
|
43 | 43 | } |
44 | 44 | function testGetFirstDay() |
45 | 45 | { |
46 | 46 | for ($i = 0; $i <= 7; ++$i) { |
47 | - $Helper = new Calendar_Table_Helper($this->mockcal,$i); |
|
48 | - $this->assertEqual($Helper->getFirstDay(),$i); |
|
47 | + $Helper = new Calendar_Table_Helper($this->mockcal, $i); |
|
48 | + $this->assertEqual($Helper->getFirstDay(), $i); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | function testGetDaysOfWeekMonday() |
52 | 52 | { |
53 | 53 | $Helper = new Calendar_Table_Helper($this->mockcal); |
54 | - $this->assertEqual($Helper->getDaysOfWeek(),array(1,2,3,4,5,6,0)); |
|
54 | + $this->assertEqual($Helper->getDaysOfWeek(), array(1, 2, 3, 4, 5, 6, 0)); |
|
55 | 55 | } |
56 | 56 | function testGetDaysOfWeekSunday() |
57 | 57 | { |
58 | - $Helper = new Calendar_Table_Helper($this->mockcal,0); |
|
59 | - $this->assertEqual($Helper->getDaysOfWeek(),array(0,1,2,3,4,5,6)); |
|
58 | + $Helper = new Calendar_Table_Helper($this->mockcal, 0); |
|
59 | + $this->assertEqual($Helper->getDaysOfWeek(), array(0, 1, 2, 3, 4, 5, 6)); |
|
60 | 60 | } |
61 | 61 | function testGetDaysOfWeekThursday() |
62 | 62 | { |
63 | - $Helper = new Calendar_Table_Helper($this->mockcal,4); |
|
64 | - $this->assertEqual($Helper->getDaysOfWeek(),array(4,5,6,0,1,2,3)); |
|
63 | + $Helper = new Calendar_Table_Helper($this->mockcal, 4); |
|
64 | + $this->assertEqual($Helper->getDaysOfWeek(), array(4, 5, 6, 0, 1, 2, 3)); |
|
65 | 65 | } |
66 | 66 | function testGetNumWeeks() |
67 | 67 | { |
68 | 68 | $Helper = new Calendar_Table_Helper($this->mockcal); |
69 | - $this->assertEqual($Helper->getNumWeeks(),5); |
|
69 | + $this->assertEqual($Helper->getNumWeeks(), 5); |
|
70 | 70 | } |
71 | 71 | function testGetNumTableDaysInMonth() |
72 | 72 | { |
73 | 73 | $Helper = new Calendar_Table_Helper($this->mockcal); |
74 | - $this->assertEqual($Helper->getNumTableDaysInMonth(),35); |
|
74 | + $this->assertEqual($Helper->getNumTableDaysInMonth(), 35); |
|
75 | 75 | } |
76 | 76 | function testGetEmptyDaysBefore() |
77 | 77 | { |
78 | 78 | $Helper = new Calendar_Table_Helper($this->mockcal); |
79 | - $this->assertEqual($Helper->getEmptyDaysBefore(),2); |
|
79 | + $this->assertEqual($Helper->getEmptyDaysBefore(), 2); |
|
80 | 80 | } |
81 | 81 | function testGetEmptyDaysAfter() |
82 | 82 | { |
83 | 83 | $Helper = new Calendar_Table_Helper($this->mockcal); |
84 | - $this->assertEqual($Helper->getEmptyDaysAfter(),33); |
|
84 | + $this->assertEqual($Helper->getEmptyDaysAfter(), 33); |
|
85 | 85 | } |
86 | 86 | function testGetEmptyDaysAfterOffset() |
87 | 87 | { |
88 | 88 | $Helper = new Calendar_Table_Helper($this->mockcal); |
89 | - $this->assertEqual($Helper->getEmptyDaysAfterOffset(),5); |
|
89 | + $this->assertEqual($Helper->getEmptyDaysAfterOffset(), 5); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | } |
18 | 18 | function setUp() |
19 | 19 | { |
20 | - $this->cal = new Calendar_Minute(2003,10,25,13,32); |
|
20 | + $this->cal = new Calendar_Minute(2003, 10, 25, 13, 32); |
|
21 | 21 | } |
22 | - function testPrevDay_Array () |
|
22 | + function testPrevDay_Array() |
|
23 | 23 | { |
24 | 24 | $this->assertEqual( |
25 | 25 | array( |
@@ -31,25 +31,25 @@ discard block |
||
31 | 31 | 'second' => 0), |
32 | 32 | $this->cal->prevDay('array')); |
33 | 33 | } |
34 | - function testPrevSecond () |
|
34 | + function testPrevSecond() |
|
35 | 35 | { |
36 | - $this->assertEqual(59,$this->cal->prevSecond()); |
|
36 | + $this->assertEqual(59, $this->cal->prevSecond()); |
|
37 | 37 | } |
38 | - function testThisSecond () |
|
38 | + function testThisSecond() |
|
39 | 39 | { |
40 | - $this->assertEqual(0,$this->cal->thisSecond()); |
|
40 | + $this->assertEqual(0, $this->cal->thisSecond()); |
|
41 | 41 | } |
42 | - function testThisSecond_Timestamp () |
|
42 | + function testThisSecond_Timestamp() |
|
43 | 43 | { |
44 | 44 | $this->assertEqual($this->cal->cE->dateToStamp( |
45 | 45 | 2003, 10, 25, 13, 32, 0), |
46 | 46 | $this->cal->thisSecond('timestamp')); |
47 | 47 | } |
48 | - function testNextSecond () |
|
48 | + function testNextSecond() |
|
49 | 49 | { |
50 | - $this->assertEqual(1,$this->cal->nextSecond()); |
|
50 | + $this->assertEqual(1, $this->cal->nextSecond()); |
|
51 | 51 | } |
52 | - function testNextSecond_Timestamp () |
|
52 | + function testNextSecond_Timestamp() |
|
53 | 53 | { |
54 | 54 | $this->assertEqual($this->cal->cE->dateToStamp( |
55 | 55 | 2003, 10, 25, 13, 32, 1), |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | } |
58 | 58 | function testGetTimeStamp() |
59 | 59 | { |
60 | - $stamp = mktime(13,32,0,10,25,2003); |
|
61 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
60 | + $stamp = mktime(13, 32, 0, 10, 25, 2003); |
|
61 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
@@ -74,36 +74,36 @@ discard block |
||
74 | 74 | function testSize() |
75 | 75 | { |
76 | 76 | $this->cal->build(); |
77 | - $this->assertEqual(_EXTCAL_TS_MINUTE,$this->cal->size()); |
|
77 | + $this->assertEqual(_EXTCAL_TS_MINUTE, $this->cal->size()); |
|
78 | 78 | } |
79 | 79 | function testFetch() |
80 | 80 | { |
81 | 81 | $this->cal->build(); |
82 | - $i=0; |
|
83 | - while ( $Child = $this->cal->fetch() ) { |
|
82 | + $i = 0; |
|
83 | + while ($Child = $this->cal->fetch()) { |
|
84 | 84 | ++$i; |
85 | 85 | } |
86 | - $this->assertEqual(_EXTCAL_TS_MINUTE,$i); |
|
86 | + $this->assertEqual(_EXTCAL_TS_MINUTE, $i); |
|
87 | 87 | } |
88 | 88 | function testFetchAll() |
89 | 89 | { |
90 | 90 | $this->cal->build(); |
91 | 91 | $children = array(); |
92 | 92 | $i = 0; |
93 | - while ( $Child = $this->cal->fetch() ) { |
|
94 | - $children[$i]=$Child; |
|
93 | + while ($Child = $this->cal->fetch()) { |
|
94 | + $children[$i] = $Child; |
|
95 | 95 | ++$i; |
96 | 96 | } |
97 | - $this->assertEqual($children,$this->cal->fetchAll()); |
|
97 | + $this->assertEqual($children, $this->cal->fetchAll()); |
|
98 | 98 | } |
99 | 99 | function testSelection() |
100 | 100 | { |
101 | 101 | require_once(CALENDAR_ROOT . 'Second.php'); |
102 | - $selection = array(new Calendar_Second(2003,10,25,13,32,43)); |
|
102 | + $selection = array(new Calendar_Second(2003, 10, 25, 13, 32, 43)); |
|
103 | 103 | $this->cal->build($selection); |
104 | 104 | $i = 0; |
105 | - while ( $Child = $this->cal->fetch() ) { |
|
106 | - if ( $i == 43 ) |
|
105 | + while ($Child = $this->cal->fetch()) { |
|
106 | + if ($i == 43) |
|
107 | 107 | break; |
108 | 108 | ++$i; |
109 | 109 | } |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | { |
28 | 28 | $this->assertEqual(new Calendar_Year(2003), $this->cal->thisYear('object')); |
29 | 29 | } |
30 | - function testPrevMonth () |
|
30 | + function testPrevMonth() |
|
31 | 31 | { |
32 | - $this->assertEqual(12,$this->cal->prevMonth()); |
|
32 | + $this->assertEqual(12, $this->cal->prevMonth()); |
|
33 | 33 | } |
34 | - function testPrevMonth_Array () |
|
34 | + function testPrevMonth_Array() |
|
35 | 35 | { |
36 | 36 | $this->assertEqual( |
37 | 37 | array( |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | 'second' => 0), |
44 | 44 | $this->cal->prevMonth('array')); |
45 | 45 | } |
46 | - function testThisMonth () |
|
46 | + function testThisMonth() |
|
47 | 47 | { |
48 | - $this->assertEqual(1,$this->cal->thisMonth()); |
|
48 | + $this->assertEqual(1, $this->cal->thisMonth()); |
|
49 | 49 | } |
50 | - function testNextMonth () |
|
50 | + function testNextMonth() |
|
51 | 51 | { |
52 | - $this->assertEqual(2,$this->cal->nextMonth()); |
|
52 | + $this->assertEqual(2, $this->cal->nextMonth()); |
|
53 | 53 | } |
54 | - function testPrevDay () |
|
54 | + function testPrevDay() |
|
55 | 55 | { |
56 | - $this->assertEqual(31,$this->cal->prevDay()); |
|
56 | + $this->assertEqual(31, $this->cal->prevDay()); |
|
57 | 57 | } |
58 | - function testPrevDay_Array () |
|
58 | + function testPrevDay_Array() |
|
59 | 59 | { |
60 | 60 | $this->assertEqual( |
61 | 61 | array( |
@@ -67,54 +67,54 @@ discard block |
||
67 | 67 | 'second' => 0), |
68 | 68 | $this->cal->prevDay('array')); |
69 | 69 | } |
70 | - function testThisDay () |
|
70 | + function testThisDay() |
|
71 | 71 | { |
72 | - $this->assertEqual(1,$this->cal->thisDay()); |
|
72 | + $this->assertEqual(1, $this->cal->thisDay()); |
|
73 | 73 | } |
74 | - function testNextDay () |
|
74 | + function testNextDay() |
|
75 | 75 | { |
76 | - $this->assertEqual(2,$this->cal->nextDay()); |
|
76 | + $this->assertEqual(2, $this->cal->nextDay()); |
|
77 | 77 | } |
78 | - function testPrevHour () |
|
78 | + function testPrevHour() |
|
79 | 79 | { |
80 | - $this->assertEqual(23,$this->cal->prevHour()); |
|
80 | + $this->assertEqual(23, $this->cal->prevHour()); |
|
81 | 81 | } |
82 | - function testThisHour () |
|
82 | + function testThisHour() |
|
83 | 83 | { |
84 | - $this->assertEqual(0,$this->cal->thisHour()); |
|
84 | + $this->assertEqual(0, $this->cal->thisHour()); |
|
85 | 85 | } |
86 | - function testNextHour () |
|
86 | + function testNextHour() |
|
87 | 87 | { |
88 | - $this->assertEqual(1,$this->cal->nextHour()); |
|
88 | + $this->assertEqual(1, $this->cal->nextHour()); |
|
89 | 89 | } |
90 | - function testPrevMinute () |
|
90 | + function testPrevMinute() |
|
91 | 91 | { |
92 | - $this->assertEqual(59,$this->cal->prevMinute()); |
|
92 | + $this->assertEqual(59, $this->cal->prevMinute()); |
|
93 | 93 | } |
94 | - function testThisMinute () |
|
94 | + function testThisMinute() |
|
95 | 95 | { |
96 | - $this->assertEqual(0,$this->cal->thisMinute()); |
|
96 | + $this->assertEqual(0, $this->cal->thisMinute()); |
|
97 | 97 | } |
98 | - function testNextMinute () |
|
98 | + function testNextMinute() |
|
99 | 99 | { |
100 | - $this->assertEqual(1,$this->cal->nextMinute()); |
|
100 | + $this->assertEqual(1, $this->cal->nextMinute()); |
|
101 | 101 | } |
102 | - function testPrevSecond () |
|
102 | + function testPrevSecond() |
|
103 | 103 | { |
104 | - $this->assertEqual(59,$this->cal->prevSecond()); |
|
104 | + $this->assertEqual(59, $this->cal->prevSecond()); |
|
105 | 105 | } |
106 | - function testThisSecond () |
|
106 | + function testThisSecond() |
|
107 | 107 | { |
108 | - $this->assertEqual(0,$this->cal->thisSecond()); |
|
108 | + $this->assertEqual(0, $this->cal->thisSecond()); |
|
109 | 109 | } |
110 | - function testNextSecond () |
|
110 | + function testNextSecond() |
|
111 | 111 | { |
112 | - $this->assertEqual(1,$this->cal->nextSecond()); |
|
112 | + $this->assertEqual(1, $this->cal->nextSecond()); |
|
113 | 113 | } |
114 | 114 | function testGetTimeStamp() |
115 | 115 | { |
116 | - $stamp = mktime(0,0,0,1,1,2003); |
|
117 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
116 | + $stamp = mktime(0, 0, 0, 1, 1, 2003); |
|
117 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
@@ -130,36 +130,36 @@ discard block |
||
130 | 130 | function testSize() |
131 | 131 | { |
132 | 132 | $this->cal->build(); |
133 | - $this->assertEqual(12,$this->cal->size()); |
|
133 | + $this->assertEqual(12, $this->cal->size()); |
|
134 | 134 | } |
135 | 135 | function testFetch() |
136 | 136 | { |
137 | 137 | $this->cal->build(); |
138 | - $i=0; |
|
139 | - while ( $Child = $this->cal->fetch() ) { |
|
138 | + $i = 0; |
|
139 | + while ($Child = $this->cal->fetch()) { |
|
140 | 140 | ++$i; |
141 | 141 | } |
142 | - $this->assertEqual(12,$i); |
|
142 | + $this->assertEqual(12, $i); |
|
143 | 143 | } |
144 | 144 | function testFetchAll() |
145 | 145 | { |
146 | 146 | $this->cal->build(); |
147 | 147 | $children = array(); |
148 | 148 | $i = 1; |
149 | - while ( $Child = $this->cal->fetch() ) { |
|
150 | - $children[$i]=$Child; |
|
149 | + while ($Child = $this->cal->fetch()) { |
|
150 | + $children[$i] = $Child; |
|
151 | 151 | ++$i; |
152 | 152 | } |
153 | - $this->assertEqual($children,$this->cal->fetchAll()); |
|
153 | + $this->assertEqual($children, $this->cal->fetchAll()); |
|
154 | 154 | } |
155 | 155 | function testSelection() |
156 | 156 | { |
157 | 157 | require_once(CALENDAR_ROOT . 'Month.php'); |
158 | - $selection = array(new Calendar_Month(2003,10)); |
|
158 | + $selection = array(new Calendar_Month(2003, 10)); |
|
159 | 159 | $this->cal->build($selection); |
160 | 160 | $i = 1; |
161 | - while ( $Child = $this->cal->fetch() ) { |
|
162 | - if ( $i == 10 ) |
|
161 | + while ($Child = $this->cal->fetch()) { |
|
162 | + if ($i == 10) |
|
163 | 163 | break; |
164 | 164 | ++$i; |
165 | 165 | } |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | $this->cal = Calendar_Factory::create('Week', 2003, 10, 9); |
22 | 22 | //print_r($this->cal); |
23 | 23 | } |
24 | - function testPrevDay () |
|
24 | + function testPrevDay() |
|
25 | 25 | { |
26 | 26 | $this->assertEqual(8, $this->cal->prevDay()); |
27 | 27 | } |
28 | - function testPrevDay_Array () |
|
28 | + function testPrevDay_Array() |
|
29 | 29 | { |
30 | 30 | $this->assertEqual( |
31 | 31 | array( |
@@ -37,58 +37,58 @@ discard block |
||
37 | 37 | 'second' => 0), |
38 | 38 | $this->cal->prevDay('array')); |
39 | 39 | } |
40 | - function testThisDay () |
|
40 | + function testThisDay() |
|
41 | 41 | { |
42 | 42 | $this->assertEqual(9, $this->cal->thisDay()); |
43 | 43 | } |
44 | - function testNextDay () |
|
44 | + function testNextDay() |
|
45 | 45 | { |
46 | 46 | $this->assertEqual(10, $this->cal->nextDay()); |
47 | 47 | } |
48 | - function testPrevHour () |
|
48 | + function testPrevHour() |
|
49 | 49 | { |
50 | 50 | $this->assertEqual(23, $this->cal->prevHour()); |
51 | 51 | } |
52 | - function testThisHour () |
|
52 | + function testThisHour() |
|
53 | 53 | { |
54 | 54 | $this->assertEqual(0, $this->cal->thisHour()); |
55 | 55 | } |
56 | - function testNextHour () |
|
56 | + function testNextHour() |
|
57 | 57 | { |
58 | 58 | $this->assertEqual(1, $this->cal->nextHour()); |
59 | 59 | } |
60 | - function testPrevMinute () |
|
60 | + function testPrevMinute() |
|
61 | 61 | { |
62 | 62 | $this->assertEqual(59, $this->cal->prevMinute()); |
63 | 63 | } |
64 | - function testThisMinute () |
|
64 | + function testThisMinute() |
|
65 | 65 | { |
66 | 66 | $this->assertEqual(0, $this->cal->thisMinute()); |
67 | 67 | } |
68 | - function testNextMinute () |
|
68 | + function testNextMinute() |
|
69 | 69 | { |
70 | 70 | $this->assertEqual(1, $this->cal->nextMinute()); |
71 | 71 | } |
72 | - function testPrevSecond () |
|
72 | + function testPrevSecond() |
|
73 | 73 | { |
74 | 74 | $this->assertEqual(59, $this->cal->prevSecond()); |
75 | 75 | } |
76 | - function testThisSecond () |
|
76 | + function testThisSecond() |
|
77 | 77 | { |
78 | 78 | $this->assertEqual(0, $this->cal->thisSecond()); |
79 | 79 | } |
80 | - function testNextSecond () |
|
80 | + function testNextSecond() |
|
81 | 81 | { |
82 | 82 | $this->assertEqual(1, $this->cal->nextSecond()); |
83 | 83 | } |
84 | 84 | function testGetTimeStamp() |
85 | 85 | { |
86 | - $stamp = mktime(0,0,0,10,9,2003); |
|
87 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
86 | + $stamp = mktime(0, 0, 0, 10, 9, 2003); |
|
87 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
88 | 88 | } |
89 | 89 | function testNewTimeStamp() |
90 | 90 | { |
91 | - $stamp = mktime(0,0,0,7,28,2004); |
|
91 | + $stamp = mktime(0, 0, 0, 7, 28, 2004); |
|
92 | 92 | $this->cal->setTimestamp($stamp); |
93 | 93 | $this->assertEqual('29 2004', date('W Y', $this->cal->prevWeek(true))); |
94 | 94 | $this->assertEqual('30 2004', date('W Y', $this->cal->thisWeek(true))); |
@@ -97,47 +97,47 @@ discard block |
||
97 | 97 | function testPrevWeekInMonth() |
98 | 98 | { |
99 | 99 | $this->assertEqual(1, $this->cal->prevWeek()); |
100 | - $stamp = mktime(0,0,0,2,3,2005); |
|
100 | + $stamp = mktime(0, 0, 0, 2, 3, 2005); |
|
101 | 101 | $this->cal->setTimestamp($stamp); |
102 | 102 | $this->assertEqual(0, $this->cal->prevWeek()); |
103 | 103 | } |
104 | 104 | function testThisWeekInMonth() |
105 | 105 | { |
106 | 106 | $this->assertEqual(2, $this->cal->thisWeek()); |
107 | - $stamp = mktime(0,0,0,2,3,2005); |
|
107 | + $stamp = mktime(0, 0, 0, 2, 3, 2005); |
|
108 | 108 | $this->cal->setTimestamp($stamp); |
109 | 109 | $this->assertEqual(1, $this->cal->thisWeek()); |
110 | - $stamp = mktime(0,0,0,1,1,2005); |
|
110 | + $stamp = mktime(0, 0, 0, 1, 1, 2005); |
|
111 | 111 | $this->cal->setTimestamp($stamp); |
112 | 112 | $this->assertEqual(1, $this->cal->thisWeek()); |
113 | - $stamp = mktime(0,0,0,1,3,2005); |
|
113 | + $stamp = mktime(0, 0, 0, 1, 3, 2005); |
|
114 | 114 | $this->cal->setTimestamp($stamp); |
115 | 115 | $this->assertEqual(2, $this->cal->thisWeek()); |
116 | 116 | } |
117 | 117 | function testNextWeekInMonth() |
118 | 118 | { |
119 | 119 | $this->assertEqual(3, $this->cal->nextWeek()); |
120 | - $stamp = mktime(0,0,0,2,3,2005); |
|
120 | + $stamp = mktime(0, 0, 0, 2, 3, 2005); |
|
121 | 121 | $this->cal->setTimestamp($stamp); |
122 | 122 | $this->assertEqual(2, $this->cal->nextWeek()); |
123 | 123 | } |
124 | 124 | function testPrevWeekInYear() |
125 | 125 | { |
126 | 126 | $this->assertEqual(date('W', $this->cal->prevWeek('timestamp')), $this->cal->prevWeek('n_in_year')); |
127 | - $stamp = mktime(0,0,0,1,1,2004); |
|
127 | + $stamp = mktime(0, 0, 0, 1, 1, 2004); |
|
128 | 128 | $this->cal->setTimestamp($stamp); |
129 | 129 | $this->assertEqual(date('W', $this->cal->nextWeek('timestamp')), $this->cal->nextWeek('n_in_year')); |
130 | 130 | } |
131 | 131 | function testThisWeekInYear() |
132 | 132 | { |
133 | 133 | $this->assertEqual(date('W', $this->cal->thisWeek('timestamp')), $this->cal->thisWeek('n_in_year')); |
134 | - $stamp = mktime(0,0,0,1,1,2004); |
|
134 | + $stamp = mktime(0, 0, 0, 1, 1, 2004); |
|
135 | 135 | $this->cal->setTimestamp($stamp); |
136 | 136 | $this->assertEqual(date('W', $this->cal->thisWeek('timestamp')), $this->cal->thisWeek('n_in_year')); |
137 | 137 | } |
138 | 138 | function testFirstWeekInYear() |
139 | 139 | { |
140 | - $stamp = mktime(0,0,0,1,4,2004); |
|
140 | + $stamp = mktime(0, 0, 0, 1, 4, 2004); |
|
141 | 141 | $this->cal->setTimestamp($stamp); |
142 | 142 | $this->assertEqual(1, $this->cal->thisWeek('n_in_year')); |
143 | 143 | } |
@@ -183,21 +183,21 @@ discard block |
||
183 | 183 | } |
184 | 184 | function testPrevWeekObject() |
185 | 185 | { |
186 | - $testWeek = Calendar_Factory::create('Week', 2003,9,28); |
|
186 | + $testWeek = Calendar_Factory::create('Week', 2003, 9, 28); |
|
187 | 187 | $Week = $this->cal->prevWeek('object'); |
188 | - $this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp()); |
|
188 | + $this->assertEqual($testWeek->getTimeStamp(), $Week->getTimeStamp()); |
|
189 | 189 | } |
190 | 190 | function testThisWeekObject() |
191 | 191 | { |
192 | - $testWeek = Calendar_Factory::create('Week', 2003,10,5); |
|
192 | + $testWeek = Calendar_Factory::create('Week', 2003, 10, 5); |
|
193 | 193 | $Week = $this->cal->thisWeek('object'); |
194 | - $this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp()); |
|
194 | + $this->assertEqual($testWeek->getTimeStamp(), $Week->getTimeStamp()); |
|
195 | 195 | } |
196 | 196 | function testNextWeekObject() |
197 | 197 | { |
198 | - $testWeek = Calendar_Factory::create('Week', 2003,10,12); |
|
198 | + $testWeek = Calendar_Factory::create('Week', 2003, 10, 12); |
|
199 | 199 | $Week = $this->cal->nextWeek('object'); |
200 | - $this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp()); |
|
200 | + $this->assertEqual($testWeek->getTimeStamp(), $Week->getTimeStamp()); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | function testFetch() |
220 | 220 | { |
221 | 221 | $this->cal->build(); |
222 | - $i=0; |
|
222 | + $i = 0; |
|
223 | 223 | while ($Child = $this->cal->fetch()) { |
224 | 224 | ++$i; |
225 | 225 | } |
@@ -230,11 +230,11 @@ discard block |
||
230 | 230 | $this->cal->build(); |
231 | 231 | $children = array(); |
232 | 232 | $i = 1; |
233 | - while ( $Child = $this->cal->fetch() ) { |
|
234 | - $children[$i]=$Child; |
|
233 | + while ($Child = $this->cal->fetch()) { |
|
234 | + $children[$i] = $Child; |
|
235 | 235 | ++$i; |
236 | 236 | } |
237 | - $this->assertEqual($children,$this->cal->fetchAll()); |
|
237 | + $this->assertEqual($children, $this->cal->fetchAll()); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | function testSelection() |
@@ -14,23 +14,23 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * @param string $name |
16 | 16 | */ |
17 | - function TestOfCalendar($name='Test of Calendar') |
|
17 | + function TestOfCalendar($name = 'Test of Calendar') |
|
18 | 18 | { |
19 | 19 | $this->UnitTestCase($name); |
20 | 20 | } |
21 | 21 | function setUp() |
22 | 22 | { |
23 | - $this->cal = new Calendar(2003,10,25,13,32,43); |
|
23 | + $this->cal = new Calendar(2003, 10, 25, 13, 32, 43); |
|
24 | 24 | } |
25 | 25 | function tearDown() |
26 | 26 | { |
27 | 27 | unset($this->cal); |
28 | 28 | } |
29 | - function testPrevYear () |
|
29 | + function testPrevYear() |
|
30 | 30 | { |
31 | - $this->assertEqual(2002,$this->cal->prevYear()); |
|
31 | + $this->assertEqual(2002, $this->cal->prevYear()); |
|
32 | 32 | } |
33 | - function testPrevYear_Array () |
|
33 | + function testPrevYear_Array() |
|
34 | 34 | { |
35 | 35 | $this->assertEqual( |
36 | 36 | array( |
@@ -42,19 +42,19 @@ discard block |
||
42 | 42 | 'second' => 0), |
43 | 43 | $this->cal->prevYear('array')); |
44 | 44 | } |
45 | - function testThisYear () |
|
45 | + function testThisYear() |
|
46 | 46 | { |
47 | - $this->assertEqual(2003,$this->cal->thisYear()); |
|
47 | + $this->assertEqual(2003, $this->cal->thisYear()); |
|
48 | 48 | } |
49 | - function testNextYear () |
|
49 | + function testNextYear() |
|
50 | 50 | { |
51 | - $this->assertEqual(2004,$this->cal->nextYear()); |
|
51 | + $this->assertEqual(2004, $this->cal->nextYear()); |
|
52 | 52 | } |
53 | - function testPrevMonth () |
|
53 | + function testPrevMonth() |
|
54 | 54 | { |
55 | - $this->assertEqual(9,$this->cal->prevMonth()); |
|
55 | + $this->assertEqual(9, $this->cal->prevMonth()); |
|
56 | 56 | } |
57 | - function testPrevMonth_Array () |
|
57 | + function testPrevMonth_Array() |
|
58 | 58 | { |
59 | 59 | $this->assertEqual( |
60 | 60 | array( |
@@ -66,19 +66,19 @@ discard block |
||
66 | 66 | 'second' => 0), |
67 | 67 | $this->cal->prevMonth('array')); |
68 | 68 | } |
69 | - function testThisMonth () |
|
69 | + function testThisMonth() |
|
70 | 70 | { |
71 | - $this->assertEqual(10,$this->cal->thisMonth()); |
|
71 | + $this->assertEqual(10, $this->cal->thisMonth()); |
|
72 | 72 | } |
73 | - function testNextMonth () |
|
73 | + function testNextMonth() |
|
74 | 74 | { |
75 | - $this->assertEqual(11,$this->cal->nextMonth()); |
|
75 | + $this->assertEqual(11, $this->cal->nextMonth()); |
|
76 | 76 | } |
77 | - function testPrevDay () |
|
77 | + function testPrevDay() |
|
78 | 78 | { |
79 | - $this->assertEqual(24,$this->cal->prevDay()); |
|
79 | + $this->assertEqual(24, $this->cal->prevDay()); |
|
80 | 80 | } |
81 | - function testPrevDay_Array () |
|
81 | + function testPrevDay_Array() |
|
82 | 82 | { |
83 | 83 | $this->assertEqual( |
84 | 84 | array( |
@@ -90,60 +90,60 @@ discard block |
||
90 | 90 | 'second' => 0), |
91 | 91 | $this->cal->prevDay('array')); |
92 | 92 | } |
93 | - function testThisDay () |
|
93 | + function testThisDay() |
|
94 | 94 | { |
95 | - $this->assertEqual(25,$this->cal->thisDay()); |
|
95 | + $this->assertEqual(25, $this->cal->thisDay()); |
|
96 | 96 | } |
97 | - function testNextDay () |
|
97 | + function testNextDay() |
|
98 | 98 | { |
99 | - $this->assertEqual(26,$this->cal->nextDay()); |
|
99 | + $this->assertEqual(26, $this->cal->nextDay()); |
|
100 | 100 | } |
101 | - function testPrevHour () |
|
101 | + function testPrevHour() |
|
102 | 102 | { |
103 | - $this->assertEqual(12,$this->cal->prevHour()); |
|
103 | + $this->assertEqual(12, $this->cal->prevHour()); |
|
104 | 104 | } |
105 | - function testThisHour () |
|
105 | + function testThisHour() |
|
106 | 106 | { |
107 | - $this->assertEqual(13,$this->cal->thisHour()); |
|
107 | + $this->assertEqual(13, $this->cal->thisHour()); |
|
108 | 108 | } |
109 | - function testNextHour () |
|
109 | + function testNextHour() |
|
110 | 110 | { |
111 | - $this->assertEqual(14,$this->cal->nextHour()); |
|
111 | + $this->assertEqual(14, $this->cal->nextHour()); |
|
112 | 112 | } |
113 | - function testPrevMinute () |
|
113 | + function testPrevMinute() |
|
114 | 114 | { |
115 | - $this->assertEqual(31,$this->cal->prevMinute()); |
|
115 | + $this->assertEqual(31, $this->cal->prevMinute()); |
|
116 | 116 | } |
117 | - function testThisMinute () |
|
117 | + function testThisMinute() |
|
118 | 118 | { |
119 | - $this->assertEqual(32,$this->cal->thisMinute()); |
|
119 | + $this->assertEqual(32, $this->cal->thisMinute()); |
|
120 | 120 | } |
121 | - function testNextMinute () |
|
121 | + function testNextMinute() |
|
122 | 122 | { |
123 | - $this->assertEqual(33,$this->cal->nextMinute()); |
|
123 | + $this->assertEqual(33, $this->cal->nextMinute()); |
|
124 | 124 | } |
125 | - function testPrevSecond () |
|
125 | + function testPrevSecond() |
|
126 | 126 | { |
127 | - $this->assertEqual(42,$this->cal->prevSecond()); |
|
127 | + $this->assertEqual(42, $this->cal->prevSecond()); |
|
128 | 128 | } |
129 | - function testThisSecond () |
|
129 | + function testThisSecond() |
|
130 | 130 | { |
131 | - $this->assertEqual(43,$this->cal->thisSecond()); |
|
131 | + $this->assertEqual(43, $this->cal->thisSecond()); |
|
132 | 132 | } |
133 | - function testNextSecond () |
|
133 | + function testNextSecond() |
|
134 | 134 | { |
135 | - $this->assertEqual(44,$this->cal->nextSecond()); |
|
135 | + $this->assertEqual(44, $this->cal->nextSecond()); |
|
136 | 136 | } |
137 | 137 | function testSetTimeStamp() |
138 | 138 | { |
139 | - $stamp = mktime(13,32,43,10,25,2003); |
|
139 | + $stamp = mktime(13, 32, 43, 10, 25, 2003); |
|
140 | 140 | $this->cal->setTimeStamp($stamp); |
141 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
141 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
142 | 142 | } |
143 | 143 | function testGetTimeStamp() |
144 | 144 | { |
145 | - $stamp = mktime(13,32,43,10,25,2003); |
|
146 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
145 | + $stamp = mktime(13, 32, 43, 10, 25, 2003); |
|
146 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
147 | 147 | } |
148 | 148 | function testIsToday() |
149 | 149 | { |
@@ -20,27 +20,27 @@ discard block |
||
20 | 20 | } |
21 | 21 | function testGetSecondsInMinute() |
22 | 22 | { |
23 | - $this->assertEqual($this->engine->getSecondsInMinute(),_EXTCAL_TS_MINUTE); |
|
23 | + $this->assertEqual($this->engine->getSecondsInMinute(), _EXTCAL_TS_MINUTE); |
|
24 | 24 | } |
25 | 25 | function testGetMinutesInHour() |
26 | 26 | { |
27 | - $this->assertEqual($this->engine->getMinutesInHour(),_EXTCAL_TS_MINUTE); |
|
27 | + $this->assertEqual($this->engine->getMinutesInHour(), _EXTCAL_TS_MINUTE); |
|
28 | 28 | } |
29 | 29 | function testGetHoursInDay() |
30 | 30 | { |
31 | - $this->assertEqual($this->engine->getHoursInDay(),24); |
|
31 | + $this->assertEqual($this->engine->getHoursInDay(), 24); |
|
32 | 32 | } |
33 | 33 | function testGetFirstDayOfWeek() |
34 | 34 | { |
35 | - $this->assertEqual($this->engine->getFirstDayOfWeek(),1); |
|
35 | + $this->assertEqual($this->engine->getFirstDayOfWeek(), 1); |
|
36 | 36 | } |
37 | 37 | function testGetWeekDays() |
38 | 38 | { |
39 | - $this->assertEqual($this->engine->getWeekDays(),array(0,1,2,3,4,5,6)); |
|
39 | + $this->assertEqual($this->engine->getWeekDays(), array(0, 1, 2, 3, 4, 5, 6)); |
|
40 | 40 | } |
41 | 41 | function testGetDaysInWeek() |
42 | 42 | { |
43 | - $this->assertEqual($this->engine->getDaysInWeek(),7); |
|
43 | + $this->assertEqual($this->engine->getDaysInWeek(), 7); |
|
44 | 44 | } |
45 | 45 | function testGetWeekNInYear() |
46 | 46 | { |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | function testGetWeeksInMonth3() |
66 | 66 | { |
67 | 67 | // Unusual cases that can cause fails (shows up with example 21.php) |
68 | - $this->assertEqual($this->engine->getWeeksInMonth(2004,2,1),5); |
|
69 | - $this->assertEqual($this->engine->getWeeksInMonth(2004,8,1),6); |
|
68 | + $this->assertEqual($this->engine->getWeeksInMonth(2004, 2, 1), 5); |
|
69 | + $this->assertEqual($this->engine->getWeeksInMonth(2004, 8, 1), 6); |
|
70 | 70 | } |
71 | 71 | function testGetDayOfWeek() |
72 | 72 | { |
@@ -74,54 +74,54 @@ discard block |
||
74 | 74 | } |
75 | 75 | function testGetFirstDayInMonth() |
76 | 76 | { |
77 | - $this->assertEqual($this->engine->getFirstDayInMonth(2003,10),3); |
|
77 | + $this->assertEqual($this->engine->getFirstDayInMonth(2003, 10), 3); |
|
78 | 78 | } |
79 | 79 | function testGetDaysInMonth() |
80 | 80 | { |
81 | - $this->assertEqual($this->engine->getDaysInMonth(2003,10),31); |
|
81 | + $this->assertEqual($this->engine->getDaysInMonth(2003, 10), 31); |
|
82 | 82 | } |
83 | 83 | function testGetMinYears() |
84 | 84 | { |
85 | - $this->assertEqual($this->engine->getMinYears(),0); |
|
85 | + $this->assertEqual($this->engine->getMinYears(), 0); |
|
86 | 86 | } |
87 | 87 | function testGetMaxYears() |
88 | 88 | { |
89 | - $this->assertEqual($this->engine->getMaxYears(),9999); |
|
89 | + $this->assertEqual($this->engine->getMaxYears(), 9999); |
|
90 | 90 | } |
91 | 91 | function testDateToStamp() |
92 | 92 | { |
93 | 93 | $stamp = '2003-10-15 13:30:45'; |
94 | - $this->assertEqual($this->engine->dateToStamp(2003,10,15,13,30,45),$stamp); |
|
94 | + $this->assertEqual($this->engine->dateToStamp(2003, 10, 15, 13, 30, 45), $stamp); |
|
95 | 95 | } |
96 | 96 | function testStampToSecond() |
97 | 97 | { |
98 | 98 | $stamp = '2003-10-15 13:30:45'; |
99 | - $this->assertEqual($this->engine->stampToSecond($stamp),45); |
|
99 | + $this->assertEqual($this->engine->stampToSecond($stamp), 45); |
|
100 | 100 | } |
101 | 101 | function testStampToMinute() |
102 | 102 | { |
103 | 103 | $stamp = '2003-10-15 13:30:45'; |
104 | - $this->assertEqual($this->engine->stampToMinute($stamp),30); |
|
104 | + $this->assertEqual($this->engine->stampToMinute($stamp), 30); |
|
105 | 105 | } |
106 | 106 | function testStampToHour() |
107 | 107 | { |
108 | 108 | $stamp = '2003-10-15 13:30:45'; |
109 | - $this->assertEqual($this->engine->stampToHour($stamp),13); |
|
109 | + $this->assertEqual($this->engine->stampToHour($stamp), 13); |
|
110 | 110 | } |
111 | 111 | function testStampToDay() |
112 | 112 | { |
113 | 113 | $stamp = '2003-10-15 13:30:45'; |
114 | - $this->assertEqual($this->engine->stampToDay($stamp),15); |
|
114 | + $this->assertEqual($this->engine->stampToDay($stamp), 15); |
|
115 | 115 | } |
116 | 116 | function testStampToMonth() |
117 | 117 | { |
118 | 118 | $stamp = '2003-10-15 13:30:45'; |
119 | - $this->assertEqual($this->engine->stampToMonth($stamp),10); |
|
119 | + $this->assertEqual($this->engine->stampToMonth($stamp), 10); |
|
120 | 120 | } |
121 | 121 | function testStampToYear() |
122 | 122 | { |
123 | 123 | $stamp = '2003-10-15 13:30:45'; |
124 | - $this->assertEqual($this->engine->stampToYear($stamp),2003); |
|
124 | + $this->assertEqual($this->engine->stampToYear($stamp), 2003); |
|
125 | 125 | } |
126 | 126 | function testAdjustDate() |
127 | 127 | { |