|
21 | 21 | if($code_output == $test_output) |
22 | 22 | $passed++; |
23 | 23 | else { |
24 | | - echo 'test '.$tests.' failed.'; |
| 24 | + echo '<br />test '.$tests.' failed.<br />'; |
25 | 25 | $failed++; |
26 | 26 | } |
27 | 27 | $tests++; |
28 | 28 |
|
29 | 29 |
|
30 | 30 | // Tests: setting options |
31 | 31 | // tables with some cells with rowspan > 1 |
| 32 | +// parsing urls |
32 | 33 | $helper->tableToJSON('http://kdic.grinnell.edu/programs/schedule/', true, 'wp-table-reloaded-id-6-no-1', array(0 => 0, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6, 6 => 7, 7 => 8, 8 => 9)); |
33 | 34 | if (false == ($out_handle = fopen($outfile, 'w'))) |
34 | 35 | die('Failed to create output file.'); |
35 | | -$output = "{\"Monday\" : [\n\t{\"cell_text\" : \"<a href=\\\"http://kdic.grinnell.edu/programs/shows/the-jenn-n-juice-show/\\\">The Jenn N' Juice Show</a>\",\n\t\"column\" : \"Monday\",\n\t\"row\" : \"8:00PM\",\n\t\"spans\" : \"2\"},\n\t{\"cell_text\" : \"<a href=\\\"http://kdic.grinnell.edu/programs/shows/west-coast-dub/ \\\">West Coast Dub</a>\",\n\t\"column\" : \"Monday\",\n\t\"row\" : \"10:00PM\",\n\t\"spans\" : \"1\"},\n\t{\"cell_text\" : \"<a href=\\\"http://kdic.grinnell.edu/programs/shows/good-touches/\\\">Good Touches</a>\",\n\t\"column\" : \"Monday\",\n\t\"row\" : \"11:00PM\",\n\t\"spans\" : \"1\"},\n\t{\"cell_text\" : \"<a href=\\\"http://kdic.grinnell.edu/programs/shows/the-ray-kdic-variety-hour/\\\">The Ray KDIC Variety Hour</a>\",\n\t\"column\" : \"Monday\",\n\t\"row\" : \"12:00AM\",\n\t\"spans\" : \"1\"}]\n}"; |
| 36 | +$output = "{\"Monday\" : [\n\t{\"cell_text\" : \"The Jenn N' Juice Show\",\n\t\"url\" : \"http://kdic.grinnell.edu/programs/shows/the-jenn-n-juice-show/\",\n\t\"column\" : \"Monday\",\n\t\"row\" : \"8:00PM\",\n\t\"spans\" : \"2\"},\n\t{\"cell_text\" : \"West Coast Dub\",\n\t\"url\" : \"http://kdic.grinnell.edu/programs/shows/west-coast-dub/ \",\n\t\"column\" : \"Monday\",\n\t\"row\" : \"10:00PM\",\n\t\"spans\" : \"1\"},\n\t{\"cell_text\" : \"Good Touches\",\n\t\"url\" : \"http://kdic.grinnell.edu/programs/shows/good-touches/\",\n\t\"column\" : \"Monday\",\n\t\"row\" : \"11:00PM\",\n\t\"spans\" : \"1\"},\n\t{\"cell_text\" : \"The Ray KDIC Variety Hour\",\n\t\"url\" : \"http://kdic.grinnell.edu/programs/shows/the-ray-kdic-variety-hour/\",\n\t\"column\" : \"Monday\",\n\t\"row\" : \"12:00AM\",\n\t\"spans\" : \"1\"}]\n}"; |
36 | 37 | fwrite($out_handle, $output); |
37 | 38 | fclose($out_handle); |
38 | 39 |
|
|
41 | 42 | if($code_output == $test_output) |
42 | 43 | $passed++; |
43 | 44 | else { |
44 | | - echo '<br />test '.$tests.' failed.'; |
| 45 | + echo '<br />test '.$tests.' failed.<br />'; |
45 | 46 | $failed++; |
46 | 47 | } |
47 | 48 | $tests++; |
|
56 | 57 | if($code_output == $test_output) |
57 | 58 | $passed++; |
58 | 59 | else { |
59 | | - echo '<br />test '.$tests.' failed.'; |
| 60 | + echo '<br />test '.$tests.' failed.<br />'; |
60 | 61 | $failed++; |
61 | 62 | } |
62 | 63 | $tests++; |
|
71 | 72 | if($code_output == $test_output) |
72 | 73 | $passed++; |
73 | 74 | else { |
74 | | - echo '<br />test '.$tests.' failed.'; |
| 75 | + echo '<br />test '.$tests.' failed.<br />'; |
75 | 76 | $failed++; |
76 | 77 | } |
77 | 78 | $tests++; |
|
91 | 92 | if($code_output == $test_output) |
92 | 93 | $passed++; |
93 | 94 | else { |
94 | | - echo '<br />test '.$tests.' failed.'; |
| 95 | + echo '<br />test '.$tests.' failed.<br />'; |
95 | 96 | $failed++; |
96 | 97 | } |
97 | 98 | $tests++; |
|
106 | 107 | if($code_output == $test_output) |
107 | 108 | $passed++; |
108 | 109 | else { |
109 | | - echo '<br />test '.$tests.' failed.'; |
| 110 | + echo '<br />test '.$tests.' failed.<br />'; |
110 | 111 | $failed++; |
111 | 112 | } |
112 | 113 | $tests++; |
|
120 | 121 | if($code_output == $test_output && $test_output == $another_output) |
121 | 122 | $passed++; |
122 | 123 | else { |
123 | | - echo '<br />test '.$tests.' failed.'; |
| 124 | + echo '<br />test '.$tests.' failed.<br />'; |
124 | 125 | $failed++; |
125 | 126 | } |
126 | 127 | $tests++; |
|
133 | 134 | if($code_output == $test_output) |
134 | 135 | $passed++; |
135 | 136 | else { |
136 | | - echo '<br />test '.$tests.' failed.'; |
| 137 | + echo '<br />test '.$tests.' failed.<br />'; |
137 | 138 | $failed++; |
138 | 139 | } |
139 | 140 | $tests++; |
|
146 | 147 | if($code_output == $test_output) |
147 | 148 | $passed++; |
148 | 149 | else { |
149 | | - echo '<br />test '.$tests.' failed.'; |
| 150 | + echo '<br />test '.$tests.' failed.<br />'; |
150 | 151 | $failed++; |
151 | 152 | } |
152 | 153 | $tests++; |
|
160 | 161 | if($code_output == $test_output) |
161 | 162 | $passed++; |
162 | 163 | else { |
163 | | - echo '<br />test '.$tests.' failed.'; |
| 164 | + echo '<br />test '.$tests.' failed.<br />'; |
164 | 165 | $failed++; |
165 | 166 | } |
166 | 167 | $tests++; |
|
175 | 176 | if($code_output == $test_output) |
176 | 177 | $passed++; |
177 | 178 | else { |
178 | | - echo '<br />test '.$tests.' failed.'; |
| 179 | + echo '<br />test '.$tests.' failed.<br />'; |
179 | 180 | $failed++; |
180 | 181 | } |
181 | 182 | $tests++; |
|
189 | 190 | if($code_output == $test_output) |
190 | 191 | $passed++; |
191 | 192 | else { |
192 | | - echo '<br />test '.$tests.' failed.'; |
| 193 | + echo '<br />test '.$tests.' failed.<br />'; |
193 | 194 | $failed++; |
194 | 195 | } |
195 | 196 | $tests++; |
|
205 | 206 | if($code_output == $test_output && $test_output == $another_output && $test_output == $third_output) |
206 | 207 | $passed++; |
207 | 208 | else { |
208 | | - echo '<br />test '.$tests.' failed.'; |
| 209 | + echo '<br />test '.$tests.' failed.<br />'; |
209 | 210 | $failed++; |
210 | 211 | } |
211 | 212 | $tests++; |
|
221 | 222 | if($code_output == $test_output && $test_output == $another_output && $test_output == $third_output) |
222 | 223 | $passed++; |
223 | 224 | else { |
224 | | - echo '<br />test '.$tests.' failed.'; |
| 225 | + echo '<br />test '.$tests.' failed.<br />'; |
225 | 226 | $failed++; |
226 | 227 | } |
227 | 228 | $tests++; |
|
237 | 238 | if($code_output == $test_output && $test_output == $another_output && $test_output == $third_output) |
238 | 239 | $passed++; |
239 | 240 | else { |
240 | | - echo '<br />test '.$tests.' failed.'; |
| 241 | + echo '<br />test '.$tests.' failed.<br />'; |
241 | 242 | $failed++; |
242 | 243 | } |
243 | 244 | $tests++; |
|
250 | 251 | $helper->tableToJSON('http://kdic.grinnell.edu/programs/schedule/', TRUE, null, null, null, false, array(1), true); |
251 | 252 | if (false == ($out_handle = fopen($outfile, 'w'))) |
252 | 253 | die('Failed to create output file.'); |
253 | | -$output = "{\t\"8:00PM\":{\n\t\t\"Monday\":\"<a href=\\\"http://kdic.grinnell.edu/programs/shows/the-jenn-n-juice-show/\\\">The Jenn N' Juice Show</a>\"\n\t},\n\t\"10:00PM\":{\n\t\t\"Monday\":\"<a href=\\\"http://kdic.grinnell.edu/programs/shows/west-coast-dub/ \\\">West Coast Dub</a>\"\n\t},\n\t\"11:00PM\":{\n\t\t\"Monday\":\"<a href=\\\"http://kdic.grinnell.edu/programs/shows/good-touches/\\\">Good Touches</a>\"\n\t},\n\t\"12:00AM\":{\n\t\t\"Monday\":\"<a href=\\\"http://kdic.grinnell.edu/programs/shows/the-ray-kdic-variety-hour/\\\">The Ray KDIC Variety Hour</a>\"\n\t}\n}"; |
| 254 | +$output = "{\t\"8:00PM\":{\n\t\t\"Monday\":\"The Jenn N' Juice Show\"\n\t},\n\t\"10:00PM\":{\n\t\t\"Monday\":\"West Coast Dub\"\n\t},\n\t\"11:00PM\":{\n\t\t\"Monday\":\"Good Touches\"\n\t},\n\t\"12:00AM\":{\n\t\t\"Monday\":\"The Ray KDIC Variety Hour\"\n\t}\n}"; |
254 | 255 | fwrite($out_handle, $output); |
255 | 256 | fclose($out_handle); |
256 | 257 |
|
|
259 | 260 | if($code_output == $test_output) |
260 | 261 | $passed++; |
261 | 262 | else { |
262 | | - echo '<br />test '.$tests.' failed.'; |
| 263 | + echo '<br />test '.$tests.' failed.<br />'; |
263 | 264 | $failed++; |
264 | 265 | } |
265 | 266 | $tests++; |
|
0 commit comments