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

Change subject: Rename GatewayForm to GatewayPage to distinguish from 
Gateway_Form
......................................................................


Rename GatewayForm to GatewayPage to distinguish from Gateway_Form

Changes the name of the GatewayForm that extends UnlistedSpecialPage,
since Gateway_Form really is specialized to render forms

Change-Id: I4552f3259ae0f2d7a35a946887e0d44ff186041f
---
M DonationInterface.php
M adyen_gateway/adyen_gateway.body.php
M adyen_gateway/adyen_resultswitcher.body.php
M amazon_gateway/amazon_gateway.body.php
M extras/custom_filters/filters/minfraud/minfraud.body.php
R gateway_common/GatewayPage.php
M gateway_forms/Form.php
M gateway_forms/RapidHtml.php
M globalcollect_gateway/globalcollect_gateway.body.php
M globalcollect_gateway/globalcollect_resultswitcher.body.php
M payflowpro_gateway/payflowpro_gateway.body.php
M paypal_gateway/paypal_gateway.body.php
M paypal_gateway/paypal_resultswitcher.body.php
M tests/Adapter/AllTests.php
M tests/AllTests.php
M tests/DonationInterfaceTestCase.php
R tests/GatewayPageTestCase.php
R tests/includes/test_page/test.gateway.pages.php
M worldpay_gateway/worldpay_gateway.body.php
19 files changed, 38 insertions(+), 40 deletions(-)

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



diff --git a/DonationInterface.php b/DonationInterface.php
index 89f8222..d9df3de 100644
--- a/DonationInterface.php
+++ b/DonationInterface.php
@@ -103,7 +103,7 @@
 $wgAutoloadClasses['DonationData'] = $donationinterface_dir . 
'gateway_common/DonationData.php';
 $wgAutoloadClasses['EncodingMangler'] = $donationinterface_dir . 
'gateway_common/EncodingMangler.php';
 $wgAutoloadClasses['GatewayAdapter'] = $donationinterface_dir . 
'gateway_common/gateway.adapter.php';
-$wgAutoloadClasses['GatewayForm'] = $donationinterface_dir . 
'gateway_common/GatewayForm.php';
+$wgAutoloadClasses['GatewayPage'] = $donationinterface_dir . 
'gateway_common/GatewayPage.php';
 $wgAutoloadClasses['DataValidator'] = $donationinterface_dir . 
'gateway_common/DataValidator.php';
 $wgAutoloadClasses['PaymentMethod'] = $donationinterface_dir . 
'gateway_common/PaymentMethod.php';
 
diff --git a/adyen_gateway/adyen_gateway.body.php 
b/adyen_gateway/adyen_gateway.body.php
index 8a72fba..05a37ae 100644
--- a/adyen_gateway/adyen_gateway.body.php
+++ b/adyen_gateway/adyen_gateway.body.php
@@ -20,7 +20,7 @@
  * AdyenGateway
  *
  */
-class AdyenGateway extends GatewayForm {
+class AdyenGateway extends GatewayPage {
 
        /**
         * Constructor - set up the new special page
diff --git a/adyen_gateway/adyen_resultswitcher.body.php 
b/adyen_gateway/adyen_resultswitcher.body.php
index 1c05364..72bbe5a 100644
--- a/adyen_gateway/adyen_resultswitcher.body.php
+++ b/adyen_gateway/adyen_resultswitcher.body.php
@@ -1,6 +1,6 @@
 <?php
 
-class AdyenGatewayResult extends GatewayForm {
+class AdyenGatewayResult extends GatewayPage {
 
        /**
         * Defines the action to take on a Adyen transaction.
diff --git a/amazon_gateway/amazon_gateway.body.php 
b/amazon_gateway/amazon_gateway.body.php
index f6ddc10..785f4b9 100644
--- a/amazon_gateway/amazon_gateway.body.php
+++ b/amazon_gateway/amazon_gateway.body.php
@@ -16,7 +16,7 @@
  *
  */
 
-class AmazonGateway extends GatewayForm {
+class AmazonGateway extends GatewayPage {
        /**
         * Constructor - set up the new special page
         */
diff --git a/extras/custom_filters/filters/minfraud/minfraud.body.php 
b/extras/custom_filters/filters/minfraud/minfraud.body.php
index 686bcf7..1100bfa 100644
--- a/extras/custom_filters/filters/minfraud/minfraud.body.php
+++ b/extras/custom_filters/filters/minfraud/minfraud.body.php
@@ -164,7 +164,7 @@
                $this->minfraudQuery['accept_language'] = 
$wgRequest->getHeader( 'accept-language' );
 
                // fetch the array of country codes
-               $country_codes = GatewayForm::getCountries();
+               $country_codes = GatewayPage::getCountries();
 
                // loop through the map and add pertinent values from $data to 
the hash
                foreach ( $map as $key => $value ) {
diff --git a/gateway_common/GatewayForm.php b/gateway_common/GatewayPage.php
similarity index 98%
rename from gateway_common/GatewayForm.php
rename to gateway_common/GatewayPage.php
index 31b9b10..4a3524e 100644
--- a/gateway_common/GatewayForm.php
+++ b/gateway_common/GatewayPage.php
@@ -17,14 +17,14 @@
  */
 
 /**
- * GatewayForm
+ * GatewayPage
  * This class is the generic unlisted special page in charge of actually 
  * displaying the form. Each gateway will have one or more direct descendants 
of 
  * this class, with most of the gateway-specific control logic in its 
handleRequest
  * function. For instance: 
extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
  *
  */
-abstract class GatewayForm extends UnlistedSpecialPage {
+abstract class GatewayPage extends UnlistedSpecialPage {
        /**
         * An array of form errors
         * @var array $errors
@@ -385,5 +385,3 @@
        }
 
 }
-
-//end of GatewayForm class definiton
diff --git a/gateway_forms/Form.php b/gateway_forms/Form.php
index 150c8bc..220fd66 100644
--- a/gateway_forms/Form.php
+++ b/gateway_forms/Form.php
@@ -162,7 +162,7 @@
                $country_options = '';
 
                // create a new array of countries with potentially translated 
country names for alphabetizing later
-               foreach ( GatewayForm::getCountries() as $iso_value => 
$full_name ) {
+               foreach ( GatewayPage::getCountries() as $iso_value => 
$full_name ) {
                        $countries[$iso_value] = wfMessage( 
'donate_interface-country-dropdown-' . $iso_value )->text();
                }
 
diff --git a/gateway_forms/RapidHtml.php b/gateway_forms/RapidHtml.php
index c83a95d..acefe86 100644
--- a/gateway_forms/RapidHtml.php
+++ b/gateway_forms/RapidHtml.php
@@ -563,7 +563,7 @@
                global $wgDonationInterfaceForbiddenCountries;
 
                //returns an array of iso_code => country name
-               $countries = GatewayForm::getCountries();
+               $countries = GatewayPage::getCountries();
 
                //unset blacklisted countries first
                foreach ( $wgDonationInterfaceForbiddenCountries as 
$country_code ) {
diff --git a/globalcollect_gateway/globalcollect_gateway.body.php 
b/globalcollect_gateway/globalcollect_gateway.body.php
index 92883c0..b5fbe04 100644
--- a/globalcollect_gateway/globalcollect_gateway.body.php
+++ b/globalcollect_gateway/globalcollect_gateway.body.php
@@ -20,7 +20,7 @@
  * GlobalCollectGateway
  *
  */
-class GlobalCollectGateway extends GatewayForm {
+class GlobalCollectGateway extends GatewayPage {
        /**
         * Constructor - set up the new special page
         */
diff --git a/globalcollect_gateway/globalcollect_resultswitcher.body.php 
b/globalcollect_gateway/globalcollect_resultswitcher.body.php
index 40a7cb0..eca5b13 100644
--- a/globalcollect_gateway/globalcollect_resultswitcher.body.php
+++ b/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -1,6 +1,6 @@
 <?php
 
-class GlobalCollectGatewayResult extends GatewayForm {
+class GlobalCollectGatewayResult extends GatewayPage {
        /**
         * Defines the action to take on a GlobalCollect transaction.
         *
diff --git a/payflowpro_gateway/payflowpro_gateway.body.php 
b/payflowpro_gateway/payflowpro_gateway.body.php
index 02562ef..f0c9c57 100644
--- a/payflowpro_gateway/payflowpro_gateway.body.php
+++ b/payflowpro_gateway/payflowpro_gateway.body.php
@@ -1,6 +1,6 @@
 <?php
 
-class PayflowProGateway extends GatewayForm {
+class PayflowProGateway extends GatewayPage {
        /**
         * Constructor - set up the new special page
         */
@@ -130,7 +130,7 @@
                        $this->getOutput()->addHTML( '<h3 
class="response_message">' . htmlspecialchars( $responseMsg, ENT_QUOTES ) . 
'</h3>' );
 
                        // translate country code into text
-                       $countries = GatewayForm::getCountries();
+                       $countries = GatewayPage::getCountries();
 
                        $rows = array(
                                'title' => array( $this->msg( 
'donate_interface-post-transaction' )->text() ),
diff --git a/paypal_gateway/paypal_gateway.body.php 
b/paypal_gateway/paypal_gateway.body.php
index 8f4afc7..1d703f8 100644
--- a/paypal_gateway/paypal_gateway.body.php
+++ b/paypal_gateway/paypal_gateway.body.php
@@ -16,7 +16,7 @@
  *
  */
 
-class PaypalGateway extends GatewayForm {
+class PaypalGateway extends GatewayPage {
 
        /**
         * Constructor - set up the new special page
diff --git a/paypal_gateway/paypal_resultswitcher.body.php 
b/paypal_gateway/paypal_resultswitcher.body.php
index 19ef3be..3056534 100644
--- a/paypal_gateway/paypal_resultswitcher.body.php
+++ b/paypal_gateway/paypal_resultswitcher.body.php
@@ -1,6 +1,6 @@
 <?php
 
-class PaypalGatewayResult extends GatewayForm {
+class PaypalGatewayResult extends GatewayPage {
 
        /**
         * Defines the action to take on a Paypal transaction.
diff --git a/tests/Adapter/AllTests.php b/tests/Adapter/AllTests.php
index eddd93e..82cab76 100644
--- a/tests/Adapter/AllTests.php
+++ b/tests/Adapter/AllTests.php
@@ -20,7 +20,7 @@
  * @see DonationInterface_Adapter_ServerTestCase
  */
 require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . '..' . 
DIRECTORY_SEPARATOR . 'includes/test_gateway/test.adapter.php';
-require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . '..' . 
DIRECTORY_SEPARATOR . 'includes/test_form/test.gateway.forms.php';
+require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . '..' . 
DIRECTORY_SEPARATOR . 'includes/test_page/test.gateway.pages.php';
 require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 
'GatewayAdapterTestCase.php';
 require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 
'GlobalCollect/AllTests.php';
 require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'PayPal/AllTests.php';
diff --git a/tests/AllTests.php b/tests/AllTests.php
index 139785b..5f03673 100644
--- a/tests/AllTests.php
+++ b/tests/AllTests.php
@@ -25,7 +25,7 @@
 require_once 'FormChooserTestCase.php';
 require_once 'IntegrationTestCase.php';
 require_once 'FraudFiltersTestCase.php';
-require_once 'GatewayFormTestCase.php';
+require_once 'GatewayPageTestCase.php';
 require_once 'EncodingManglerTestCase.php';
 
 /**
@@ -60,7 +60,7 @@
                $suite->addTestSuite( 'DonationInterface_FormChooserTestCase' );
                $suite->addTestSuite( 'DonationInterface_IntegrationTestCase' );
                $suite->addTestSuite( 'DonationInterface_FraudFiltersTestCase' 
);
-               $suite->addTestSuite( 'GatewayFormTestCase' );
+               $suite->addTestSuite( 'GatewayPageTestCase' );
                $suite->addTestSuite( 'EncodingManglerTestCase' );
 //             $suite->addTest(DonationInterface_Adapter_AllTests::suite());
 
diff --git a/tests/DonationInterfaceTestCase.php 
b/tests/DonationInterfaceTestCase.php
index 24c7084..9052e99 100644
--- a/tests/DonationInterfaceTestCase.php
+++ b/tests/DonationInterfaceTestCase.php
@@ -18,7 +18,7 @@
 
 require_once __DIR__ . '/TestConfiguration.php';
 require_once dirname( __FILE__ ) . '/includes/test_gateway/test.adapter.php';
-require_once dirname( __FILE__ ) . 
'/includes/test_form/test.gateway.forms.php';
+require_once dirname( __FILE__ ) . 
'/includes/test_page/test.gateway.pages.php';
 require_once dirname( __FILE__ ) . '/includes/test_request/test.request.php';
 require_once dirname( __FILE__ ) . '/includes/test_language/test.language.php';
 
@@ -379,7 +379,7 @@
         * supplied in $perform_these_checks.
         * Optional: Asserts that the gateway has logged nothing at ERROR level.
         *
-        * @param class $special_page_class A testing descendant of GatewayForm
+        * @param class $special_page_class A testing descendant of GatewayPage
         * @param array $initial_vars Array that will be loaded straight into a
         * test version of $wgRequest.
         * @param array $perform_these_checks Array of checks to perform in the
diff --git a/tests/GatewayFormTestCase.php b/tests/GatewayPageTestCase.php
similarity index 86%
rename from tests/GatewayFormTestCase.php
rename to tests/GatewayPageTestCase.php
index 562d588..c7ab51b 100644
--- a/tests/GatewayFormTestCase.php
+++ b/tests/GatewayPageTestCase.php
@@ -21,7 +21,7 @@
  */
 require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 
'DonationInterfaceTestCase.php';
 
-class TestingGatewayForm extends GatewayForm {
+class TestingGatewayPage extends GatewayPage {
        public function __construct() {
                //nothing!
        }
@@ -33,22 +33,22 @@
 /**
  * @group Fundraising
  * @group DonationInterface
- * @group GatewayForm
+ * @group GatewayPage
  */
-class GatewayFormTestCase extends MediaWikiTestCase {
+class GatewayPageTestCase extends MediaWikiTestCase {
 
-       protected $form;
+       protected $page;
        protected $adapter;
 
        public function setUp() {
-               $this->form = new TestingGatewayForm();
+               $this->page = new TestingGatewayPage();
                $this->adapter = new TestingGenericAdapter();
                $this->adapter->addData( array(
                        'amount' => '120',
                        'currency_code' => 'SGD' ) );
                $this->adapter->errorsForRevalidate[0] = array( 'currency_code' 
=> 'blah' );
                $this->adapter->errorsForRevalidate[1] = array();
-               $this->form->adapter = $this->adapter;
+               $this->page->adapter = $this->adapter;
                TestingGenericAdapter::$fakeGlobals = array ( 
'FallbackCurrency' => 'USD' );
                parent::setUp();
        }
@@ -56,10 +56,10 @@
        public function testFallbackWithNotification() {
                TestingGenericAdapter::$fakeGlobals['NotifyOnConvert'] = true;
 
-               $this->form->validateForm();
+               $this->page->validateForm();
 
                $manualErrors = $this->adapter->getManualErrors();
-               $msg = $this->form->msg( 
'donate_interface-fallback-currency-notice', 'USD' )->text();
+               $msg = $this->page->msg( 
'donate_interface-fallback-currency-notice', 'USD' )->text();
                $this->assertEquals( $msg, $manualErrors['general'] );
                $this->assertEquals( 100, 
$this->adapter->getData_Unstaged_Escaped( 'amount' ) );
                $this->assertEquals( 'USD', 
$this->adapter->getData_Unstaged_Escaped( 'currency_code' ) );
@@ -69,10 +69,10 @@
                TestingGenericAdapter::$fakeGlobals['FallbackCurrency'] = 'NZD';
                TestingGenericAdapter::$fakeGlobals['NotifyOnConvert'] = true;
 
-               $this->form->validateForm();
+               $this->page->validateForm();
 
                $manualErrors = $this->adapter->getManualErrors();
-               $msg = $this->form->msg( 
'donate_interface-fallback-currency-notice', 'NZD' )->text();
+               $msg = $this->page->msg( 
'donate_interface-fallback-currency-notice', 'NZD' )->text();
                $this->assertEquals( $msg, $manualErrors['general'] );
                $this->assertEquals( 110, 
$this->adapter->getData_Unstaged_Escaped( 'amount' ) );
                $this->assertEquals( 'NZD', 
$this->adapter->getData_Unstaged_Escaped( 'currency_code' ) );
@@ -81,7 +81,7 @@
        public function testFallbackWithoutNotification() {
                TestingGenericAdapter::$fakeGlobals['NotifyOnConvert'] = false;
 
-               $this->form->validateForm();
+               $this->page->validateForm();
 
                $manualErrors = $this->adapter->getManualErrors();
                $this->assertEquals( null, $manualErrors['general'] );
@@ -93,10 +93,10 @@
                TestingGenericAdapter::$fakeGlobals['NotifyOnConvert'] = false;
                $this->adapter->errorsForRevalidate[1] = array( 'amount' => 
'bad amount' );
 
-               $this->form->validateForm();
+               $this->page->validateForm();
 
                $manualErrors = $this->adapter->getManualErrors();
-               $msg = $this->form->msg( 
'donate_interface-fallback-currency-notice', 'USD' )->text();
+               $msg = $this->page->msg( 
'donate_interface-fallback-currency-notice', 'USD' )->text();
                $this->assertEquals( $msg, $manualErrors['general'] );
                $this->assertEquals( 100, 
$this->adapter->getData_Unstaged_Escaped( 'amount' ) );
                $this->assertEquals( 'USD', 
$this->adapter->getData_Unstaged_Escaped( 'currency_code' ) );
@@ -105,7 +105,7 @@
        public function testNoFallbackForSupportedCurrency() {
                $this->adapter->errorsForRevalidate[0] = array( 'address' => 
'blah' );
 
-               $this->form->validateForm();
+               $this->page->validateForm();
 
                $manualErrors = $this->adapter->getManualErrors();
                $this->assertEquals( null, $manualErrors['general'] );
diff --git a/tests/includes/test_form/test.gateway.forms.php 
b/tests/includes/test_page/test.gateway.pages.php
similarity index 88%
rename from tests/includes/test_form/test.gateway.forms.php
rename to tests/includes/test_page/test.gateway.pages.php
index 1a12eaf..a4af88f 100644
--- a/tests/includes/test_form/test.gateway.forms.php
+++ b/tests/includes/test_page/test.gateway.pages.php
@@ -29,7 +29,7 @@
 
        public function __construct() {
                $this->adapter = new TestingGlobalCollectAdapter();
-               GatewayForm::__construct(); //DANGER: See main class comments.
+               GatewayPage::__construct(); //DANGER: See main class comments.
        }
 
 }
@@ -38,7 +38,7 @@
 
        public function __construct() {
                $this->adapter = new TestingWorldPayAdapter();
-               GatewayForm::__construct(); //DANGER: See main class comments.
+               GatewayPage::__construct(); //DANGER: See main class comments.
        }
 
 }
@@ -46,6 +46,6 @@
 class TestingAmazonGateway extends AmazonGateway {
        public function __construct() {
                $this->adapter = new TestingAmazonAdapter();
-               GatewayForm::__construct();
+               GatewayPage::__construct();
        }
 }
diff --git a/worldpay_gateway/worldpay_gateway.body.php 
b/worldpay_gateway/worldpay_gateway.body.php
index f35badb..2b6e149 100644
--- a/worldpay_gateway/worldpay_gateway.body.php
+++ b/worldpay_gateway/worldpay_gateway.body.php
@@ -20,7 +20,7 @@
  * WorldPayGateway
  *
  */
-class WorldPayGateway extends GatewayForm {
+class WorldPayGateway extends GatewayPage {
 
        /**
         * Constructor - set up the new special page

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4552f3259ae0f2d7a35a946887e0d44ff186041f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to