Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/224991
Change subject: PHPUnit test for DonationInterface::createAdapter ...................................................................... PHPUnit test for DonationInterface::createAdapter Helps not break recurring GlobalCollect. Currently failing because of wacky session detection bug I tried to sledgehammer with I3875c7386572041b1b111d62e341c46894f0ad1f Bug: T105848 Change-Id: Ib2e2d7ff113fec3ceb5b99f4db8140920e437ed8 --- A sites/all/modules/wmf_civicrm/tests/phpunit/DonationInterfaceTest.php 1 file changed, 34 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/91/224991/1 diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/DonationInterfaceTest.php b/sites/all/modules/wmf_civicrm/tests/phpunit/DonationInterfaceTest.php new file mode 100644 index 0000000..e5437fa --- /dev/null +++ b/sites/all/modules/wmf_civicrm/tests/phpunit/DonationInterfaceTest.php @@ -0,0 +1,34 @@ +<?php + +/** + * Helps us not break the DonationInterface gateway adapter wrapper + * + * @group WmfCivicrm + */ +class DonationInterfaceTest extends BaseWmfDrupalPhpUnitTestCase { + + /** + * Do we blow up on the launch pad? + */ + public function testCreateAdapter() { + $values = array( + 'amount' => 9.99, + 'effort_id' => 1, + 'order_id' => mt_rand(), + 'currency_code' => 'USD', + 'payment_product' => '', + 'language' => 'en', + 'contribution_tracking_id' => mt_rand(), + 'referrer' => 'dummy', + ); + $adapter = DonationInterface::createAdapter( 'GlobalCollect', $values ); + // see FIXME in recurring globalcollect + $adapter->addRequestData( array( + 'effort_id' => 1, + ) ); + $data = $adapter->getData_Unstaged_Escaped(); + foreach ( $values as $key => $value ) { + $this->assertEquals( $value, $data[$key], "$key is being mangled in adapter construction" ); + } + } +} -- To view, visit https://gerrit.wikimedia.org/r/224991 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2e2d7ff113fec3ceb5b99f4db8140920e437ed8 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm 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