Awight has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/172882

Change subject: WIP BannerChoiceData RL module test
......................................................................

WIP BannerChoiceData RL module test

Change-Id: I66fb71d395fec137c6670b2bc7fecf87ca7481f6
---
M CentralNotice.hooks.php
A tests/CNBannerChoicesResourceLoaderModuleTest.php
2 files changed, 49 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/82/172882/1

diff --git a/CentralNotice.hooks.php b/CentralNotice.hooks.php
index 6fa682b..515fb77 100644
--- a/CentralNotice.hooks.php
+++ b/CentralNotice.hooks.php
@@ -368,6 +368,7 @@
        $files[ ] = __DIR__ . '/tests/CentralNoticeTest.php';
        $files[ ] = __DIR__ . '/tests/BannerChoiceDataProviderTest.php';
        $files[ ] = __DIR__ . '/tests/BannerTest.php';
+       $files[ ] = __DIR__ . 
'/tests/CNBannerChoicesResourceLoaderModuleTest.php';
        return true;
 }
 
diff --git a/tests/CNBannerChoicesResourceLoaderModuleTest.php 
b/tests/CNBannerChoicesResourceLoaderModuleTest.php
new file mode 100644
index 0000000..1c2ede0
--- /dev/null
+++ b/tests/CNBannerChoicesResourceLoaderModuleTest.php
@@ -0,0 +1,48 @@
+<?php
+
+/**
+ * @group CentralNotice
+ * @group medium
+ * @group Database
+ */
+class CNBannerChoicesResourceLoaderModuleTest extends MediaWikiTestCase {
+       /** @var CentralNoticeTestFixtures */
+       protected $cnFixtures;
+
+       protected function setUp() {
+               parent::setUp();
+
+               $this->cnFixtures = new CentralNoticeTestFixtures();
+       }
+
+       protected function tearDown() {
+               $this->cnFixtures->removeFixtures();
+               parent::tearDown();
+       }
+
+       /**
+        * @dataProvider CentralNoticeTestFixtures::allocationsData
+TODO: depends on Ia5abd44f92ecc3e378a55f566a78d075f3d1726b
+
+       public function testChoiceResponseData( $fixtures, $expected ) {
+               $this->cnFixtures->addFixtures( $fixtures );
+
+               $fauxRequest = new FauxRequest( array(
+                       'modules' => 'ext.centralNotice.bannerChoiceData',
+                       'skin' => 'Vector',
+                       'user' => false,
+                       '
+               $allocationsProvider = new BannerChoiceDataProvider(
+                       'wikipedia',
+                       'en',
+                       BannerChoiceDataProvider::ANONYMOUS
+               );
+               $choices = $allocationsProvider->getChoices();
+               $this->assertTrue( ComparisonUtil::assertSuperset( $choices, 
$expected ) );
+
+               if ( empty( $expected ) ) {
+                       $this->assertEmpty( $choices );
+               }
+       }
+        */
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/172882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66fb71d395fec137c6670b2bc7fecf87ca7481f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to