Index: trunk/extensions/CentralNotice/tests/CentralNoticeTest.php |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | protected static $centralNotice; |
10 | 10 | |
11 | 11 | protected function setUp() { |
| 12 | + parent::setUp(); |
12 | 13 | self::$centralNotice = new CentralNotice; |
13 | 14 | $noticeName = 'PHPUnitTestCampaign'; |
14 | 15 | $enabled = 0; |
— | — | @@ -27,6 +28,7 @@ |
28 | 29 | } |
29 | 30 | |
30 | 31 | protected function tearDown() { |
| 32 | + parent::tearDown(); |
31 | 33 | self::$centralNotice->removeCampaign( 'PHPUnitTestCampaign' ); |
32 | 34 | } |
33 | 35 | |
Index: trunk/extensions/CentralNotice/CentralNotice.db.php |
— | — | @@ -192,7 +192,7 @@ |
193 | 193 | |
194 | 194 | $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname ); |
195 | 195 | |
196 | | - $templates = array(); |
| 196 | + $banners = array(); |
197 | 197 | |
198 | 198 | if ( $campaigns ) { |
199 | 199 | $res = $dbr->select( |
— | — | @@ -219,18 +219,18 @@ |
220 | 220 | ); |
221 | 221 | |
222 | 222 | foreach ( $res as $row ) { |
223 | | - $templates[] = array( |
224 | | - 'name' => $row->tmp_name, |
225 | | - 'weight' => intval( $row->tmp_weight ), |
226 | | - 'display_anon' => intval( $row->tmp_display_anon ), |
227 | | - 'display_account' => intval( $row->tmp_display_account ), |
228 | | - 'fundraising' => intval( $row->tmp_fundraising ), |
229 | | - 'landing_pages' => $row->tmp_landing_pages, |
230 | | - 'campaign' => $row->not_name |
| 223 | + $banners[] = array( |
| 224 | + 'name' => $row->tmp_name, // name of the banner |
| 225 | + 'weight' => intval( $row->tmp_weight ), // weight assigned to the banner |
| 226 | + 'display_anon' => intval( $row->tmp_display_anon ), // display to anonymous users? |
| 227 | + 'display_account' => intval( $row->tmp_display_account ), // display to logged in users? |
| 228 | + 'fundraising' => intval( $row->tmp_fundraising ), // fundraising banner? |
| 229 | + 'landing_pages' => $row->tmp_landing_pages, // landing pages to link to |
| 230 | + 'campaign' => $row->not_name // campaign the banner is assigned to |
231 | 231 | ); |
232 | 232 | } |
233 | 233 | } |
234 | | - return $templates; |
| 234 | + return $banners; |
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
— | — | @@ -309,12 +309,12 @@ |
310 | 310 | } |
311 | 311 | } |
312 | 312 | |
313 | | - $templates = array(); |
| 313 | + $banners = array(); |
314 | 314 | if ( $campaigns ) { |
315 | 315 | // Pull all banners assigned to the campaigns |
316 | | - $templates = CentralNoticeDB::getCampaignBanners( $campaigns ); |
| 316 | + $banners = CentralNoticeDB::getCampaignBanners( $campaigns ); |
317 | 317 | } |
318 | | - return $templates; |
| 318 | + return $banners; |
319 | 319 | } |
320 | 320 | |
321 | 321 | /* |