Adamw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/55820
Change subject: fix unit tests
......................................................................
fix unit tests
needed to sort lists
and set priority flags
Change-Id: I39fb63f732d3d36c3bb550e9325fa03577b0c9c0
---
M tests/CentralNoticeTest.php
1 file changed, 12 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice
refs/changes/20/55820/1
diff --git a/tests/CentralNoticeTest.php b/tests/CentralNoticeTest.php
index 69bd02e..20fe84a 100644
--- a/tests/CentralNoticeTest.php
+++ b/tests/CentralNoticeTest.php
@@ -28,6 +28,7 @@
$project_languages = array( 'en', 'de' );
$geotargeted = 1;
$geo_countries = array( 'US', 'AF' );
+ $preferred = 1;
$this->campaignArray = array(
'enabled' => '0',
@@ -49,6 +50,7 @@
}
Campaign::addCampaign( $noticeName, $enabled, $startTs,
$projects,
$project_languages, $geotargeted, $geo_countries,
$this->userUser );
+ Campaign::setNumericCampaignSetting( $noticeName, 'preferred',
$preferred );
$this->campaignId = Campaign::getNoticeId(
'PHPUnitTestCampaign' );
@@ -60,7 +62,7 @@
$fundraising = 1;
$autolink = 0;
$landingPages = 'JA1, JA2';
- $campaign_z_index = 0;
+ $campaign_z_index = 1;
$this->campaignBannersJson =
'[{"name":"PHPUnitTestBanner","weight":25,"display_anon":1,"display_account":1,"fundraising":1,"autolink":0,"landing_pages":"JA1,
JA2","campaign":"PHPUnitTestCampaign","campaign_z_index":"1","campaign_num_buckets":1,"bucket":0}]';
@@ -85,23 +87,29 @@
}
public function testGetNoticeProjects() {
+ $projects = Campaign::getNoticeProjects( 'PHPUnitTestCampaign'
);
+ sort( $projects );
$this->assertEquals(
array ( 'wikibooks', 'wikipedia' ),
- Campaign::getNoticeProjects( 'PHPUnitTestCampaign' )
+ $projects
);
}
public function testGetNoticeLanguages() {
+ $languages = Campaign::getNoticeLanguages(
'PHPUnitTestCampaign' );
+ sort( $languages );
$this->assertEquals(
array ( 'de', 'en' ),
- Campaign::getNoticeLanguages( 'PHPUnitTestCampaign' )
+ $languages
);
}
public function testGetNoticeCountries() {
+ $countries = Campaign::getNoticeCountries(
'PHPUnitTestCampaign' );
+ sort( $countries );
$this->assertEquals(
array ( 'AF', 'US' ),
- Campaign::getNoticeCountries( 'PHPUnitTestCampaign' )
+ $countries
);
}
--
To view, visit https://gerrit.wikimedia.org/r/55820
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I39fb63f732d3d36c3bb550e9325fa03577b0c9c0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits