jenkins-bot has submitted this change and it was merged.

Change subject: Test forms load for Italy
......................................................................


Test forms load for Italy

GlobalCollect vmaj and Paypal

Change-Id: I96b2336e52a328633c922b20cd0d5e245a69fffc
---
M tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php
M tests/Adapter/PayPal/PayPalTestCase.php
M tests/DonationInterfaceTestCase.php
3 files changed, 77 insertions(+), 0 deletions(-)

Approvals:
  Awight: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php 
b/tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php
index dd46e6a..cefcc18 100644
--- a/tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php
+++ b/tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php
@@ -87,6 +87,42 @@
        }
 
        /**
+        * Ensure that form loads for Italy
+        */
+       public function testGlobalCollectFormLoad_IT() {
+               $init = $this->getDonorTestData( 'IT' );
+               unset( $init['order_id'] );
+               $init['payment_method'] = 'cc';
+               $init['payment_submethod'] = 'visa';
+               $init['ffname'] = 'cc-vmaj';
+
+               $assertNodes = array (
+                       'selected-amount' => array (
+                               'nodename' => 'span',
+                               'innerhtml' => '€1.55',
+                       ),
+                       'fname' => array (
+                               'nodename' => 'input',
+                               'placeholder' => wfMessage( 
'donate_interface-donor-fname')->inLanguage( 'it' )->text(),
+                       ),
+                       'lname' => array (
+                               'nodename' => 'input',
+                               'placeholder' => wfMessage( 
'donate_interface-donor-lname')->inLanguage( 'it' )->text(),
+                       ),
+                       'informationsharing' => array (
+                               'nodename' => 'p',
+                               'innerhtml' => wfMessage( 
'donate_interface-informationsharing', '.*' )->inLanguage( 'it' )->text(),
+                       ),
+                       'country' => array (
+                               'nodename' => 'select',
+                               'selected' => 'IT',
+                       ),
+               );
+
+               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
+       }
+
+       /**
         * Make sure Belgian form loads in all of that country's supported 
languages
         * @dataProvider belgiumLanguageProvider
         */
diff --git a/tests/Adapter/PayPal/PayPalTestCase.php 
b/tests/Adapter/PayPal/PayPalTestCase.php
index 2bed263..cbfcaf3 100644
--- a/tests/Adapter/PayPal/PayPalTestCase.php
+++ b/tests/Adapter/PayPal/PayPalTestCase.php
@@ -191,4 +191,34 @@
                        array( 'fr' ),
                );
        }
+
+       /**
+        * Integration test to verify that the Donate transaction works as 
expected in Italy
+        */
+       function testDoTransactionDonate_IT() {
+               $init = $this->getDonorTestData( 'IT' );
+               $this->setLanguage( 'it' );
+               $gateway = $this->getFreshGatewayObject( $init );
+               $donateText = wfMessage( 
'donate_interface-donation-description' )->inLanguage( 'it' )->text();
+               $ret = $gateway->do_transaction( 'Donate' );
+               parse_str( parse_url( $ret['redirect'], PHP_URL_QUERY ), $res );
+
+               $expected = array (
+                       'amount' => $init['amount'],
+                       'currency_code' => $init['currency_code'],
+                       'country' => 'IT',
+                       'business' => 'phpunittest...@wikimedia.org',
+                       'cmd' => '_donations',
+                       'item_name' => $donateText,
+                       'item_number' => 'DONATE',
+                       'no_note' => '0',
+                       'custom' => $gateway->getData_Unstaged_Escaped( 
'contribution_tracking_id' ),
+                       'lc' => 'IT',
+                       'cancel_return' => $gateway->getGlobal( 'ReturnURL' ),
+                       'return' => $gateway->getGlobal( 'ReturnURL' ),
+               );
+
+               $this->assertEquals( $expected, $res, 'Paypal "Donate" 
transaction not constructing the expected redirect URL' );
+               $this->assertNull( $gateway->getData_Unstaged_Escaped( 
'order_id' ), "Paypal order_id is not null, and we shouldn't be generating one" 
);
+       }
 }
diff --git a/tests/DonationInterfaceTestCase.php 
b/tests/DonationInterfaceTestCase.php
index 802441d..8884b00 100644
--- a/tests/DonationInterfaceTestCase.php
+++ b/tests/DonationInterfaceTestCase.php
@@ -181,6 +181,17 @@
                                'amount' => '1.55',
                                'language' => 'nl',
                        ),
+                       'IT' => array (
+                               'city' => 'Torino',
+                               'state' => 'TO',
+                               'zip' => '10123',
+                               'currency_code' => 'EUR',
+                               'street' => 'Via Falso 123',
+                               'fname' => 'Nome',
+                               'lname' => 'Cognome',
+                               'amount' => '1.55',
+                               'language' => 'it',
+                       ),
                );
                //default to US
                if ( $country === '' ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I96b2336e52a328633c922b20cd0d5e245a69fffc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Katie Horn <kh...@wikimedia.org>
Gerrit-Reviewer: Mwalker <mwal...@khaosdev.com>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to