r92646 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92645‎ | r92646 | r92647 >
Date:17:51, 20 July 2011
Author:kaldari
Status:ok
Tags:
Comment:
updating terminology, loading set-up and tear-down from parent in casethey do something useful
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.db.php (modified) (history)
  • /trunk/extensions/CentralNotice/tests/CentralNoticeTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/tests/CentralNoticeTest.php
@@ -8,6 +8,7 @@
99 protected static $centralNotice;
1010
1111 protected function setUp() {
 12+ parent::setUp();
1213 self::$centralNotice = new CentralNotice;
1314 $noticeName = 'PHPUnitTestCampaign';
1415 $enabled = 0;
@@ -27,6 +28,7 @@
2829 }
2930
3031 protected function tearDown() {
 32+ parent::tearDown();
3133 self::$centralNotice->removeCampaign( 'PHPUnitTestCampaign' );
3234 }
3335
Index: trunk/extensions/CentralNotice/CentralNotice.db.php
@@ -192,7 +192,7 @@
193193
194194 $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
195195
196 - $templates = array();
 196+ $banners = array();
197197
198198 if ( $campaigns ) {
199199 $res = $dbr->select(
@@ -219,18 +219,18 @@
220220 );
221221
222222 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
231231 );
232232 }
233233 }
234 - return $templates;
 234+ return $banners;
235235 }
236236
237237 /**
@@ -309,12 +309,12 @@
310310 }
311311 }
312312
313 - $templates = array();
 313+ $banners = array();
314314 if ( $campaigns ) {
315315 // Pull all banners assigned to the campaigns
316 - $templates = CentralNoticeDB::getCampaignBanners( $campaigns );
 316+ $banners = CentralNoticeDB::getCampaignBanners( $campaigns );
317317 }
318 - return $templates;
 318+ return $banners;
319319 }
320320
321321 /*

Follow-up revisions

RevisionCommit summaryAuthorDate
r92647MFT r75956 - r92645 for LandingCheck.i18n.ph, r78862 - r92646 for SpecialLand...awjrichards17:54, 20 July 2011

Status & tagging log