Ejegg has uploaded a new change for review.

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

Change subject: WIP: Test cases for Belgium
......................................................................

WIP: Test cases for Belgium

Change-Id: Ib5e0a11706307b7e5f0368aa5a082111f483176c
---
M tests/Adapter/WorldPay/WorldPayTestCase.php
M tests/DonationInterfaceTestCase.php
2 files changed, 60 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/92/150892/1

diff --git a/tests/Adapter/WorldPay/WorldPayTestCase.php 
b/tests/Adapter/WorldPay/WorldPayTestCase.php
index 4fb462e..3e24300 100644
--- a/tests/Adapter/WorldPay/WorldPayTestCase.php
+++ b/tests/Adapter/WorldPay/WorldPayTestCase.php
@@ -192,6 +192,55 @@
        }
 
        /**
+        * Make sure Belgian form load in all of that country's supported 
languages
+        * @dataProvider belgiumLanguageProvider
+        */
+       public function testWorldPayFormLoad_BE( $language ) {
+               $init = $this->getDonorTestData( 'BE' );
+               unset( $init['order_id'] );
+               $init['payment_method'] = 'cc';
+               $init['payment_submethod'] = 'visa';
+               $init['ffname'] = 'worldpay';
+               $init['language'] = $language;
+
+               $assertNodes = array (
+                       'selected-amount' => array (
+                               'nodename' => 'span',
+                               'innerhtml' => '€1.55',
+                       ),
+                       'fname-label' => array (
+                               'nodename' => 'label',
+                               'innerhtml' => wfMessage( 
'donate_interface-donor-fname' )->inLanguage( $language )->text(),
+                       ),
+                       'lname-label' => array (
+                               'nodename' => 'label',
+                               'innerhtml' => wfMessage( 
'donate_interface-donor-lname' )->inLanguage( $language )->text(),
+                       ),
+                       'emailAdd-label' => array (
+                               'nodename' => 'label',
+                               'innerhtml' => wfMessage( 
'donate_interface-donor-email' )->inLanguage( $language )->text(),
+                       ),
+                       'informationsharing' => array (
+                               'nodename' => 'p',
+                               'innerhtml' => wfMessage( 
'donate_interface-informationsharing', '.*' )->inLanguage( $language )->text(),
+                       ),
+               );
+
+               $this->verifyFormOutput( 'TestingWorldPayGateway', $init, 
$assertNodes, true );
+       }
+
+       /**
+        * Supported languages for Belgium
+        */
+       public function belgiumLanguageProvider() {
+               return array(
+                       array( 'nl' ),
+                       array( 'de' ),
+                       array( 'fr' ),
+               );
+       }
+
+       /**
         * Testing that we can retrieve the cvv_match value and run antifraud 
on it correctly
         */
        function testAntifraudCVVMatch() {
diff --git a/tests/DonationInterfaceTestCase.php 
b/tests/DonationInterfaceTestCase.php
index 213e845..ee61f16 100644
--- a/tests/DonationInterfaceTestCase.php
+++ b/tests/DonationInterfaceTestCase.php
@@ -165,6 +165,17 @@
                                'amount' => '1.55',
                                'language' => 'nl',
                        ),
+                       'BE' => array (
+                               'city' => 'Antwerp',
+                               'state' => 'XX',
+                               'zip' => '0',
+                               'currency_code' => 'EUR',
+                               'street' => '123 nep straat',
+                               'fname' => 'Voornaam',
+                               'lname' => 'Achternaam',
+                               'amount' => '1.55',
+                               'language' => 'nl',
+                       ),
                );
                //default to US
                if ( $country === '' ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5e0a11706307b7e5f0368aa5a082111f483176c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to