Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/322810
Change subject: Merge commit 'fdd8342' into deployment ...................................................................... Merge commit 'fdd8342' into deployment 5db2b21 Clean up a couple unused things fdd8342 Expire old pending messages Change-Id: Id551f7e48da1f44553d8d21a49397a22c3918655 --- D PaymentProviders/Amazon/Tests/AmazonTestCase.php D PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php 2 files changed, 0 insertions(+), 61 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/10/322810/1 diff --git a/PaymentProviders/Amazon/Tests/AmazonTestCase.php b/PaymentProviders/Amazon/Tests/AmazonTestCase.php deleted file mode 100644 index 3e95efd..0000000 --- a/PaymentProviders/Amazon/Tests/AmazonTestCase.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -namespace SmashPig\PaymentProviders\Amazon\Tests; - -use ReflectionClass; -use SmashPig\Core\Context; -use SmashPig\Tests\BaseSmashPigUnitTestCase; - -class AmazonTestCase extends BaseSmashPigUnitTestCase { - - protected $mockClient; - - public function setUp() { - parent::setUp(); - chdir( __DIR__ ); // So the mock client can find its response files - $config = AmazonTestConfiguration::instance(); - Context::initWithLogger( $config ); - $this->mockClient = $config->object( 'payments-client', true ); - $this->mockClient->calls = array(); - $this->mockClient->returns = array(); - $this->mockClient->exceptions = array(); - } - - public function tearDown() { - parent::tearDown(); - $api = new ReflectionClass( 'SmashPig\PaymentProviders\Amazon\AmazonApi' ); - $instance = $api->getProperty( 'instance' ); - $instance->setAccessible( true ); - $instance->setValue( null ); - } -} diff --git a/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php b/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php deleted file mode 100644 index 9b34964..0000000 --- a/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -namespace SmashPig\PaymentProviders\Amazon\Tests; - -use SmashPig\PaymentProviders\Amazon\Actions\ReconstructMerchantReference; -use SmashPig\PaymentProviders\Amazon\ExpatriatedMessages\CaptureCompleted; - -class ActionsTest extends AmazonTestCase { - - public function testReconstructMerchantId() { - $captureCompleted = $this->loadJson( __DIR__ . "/../Data/IPN/CaptureCompleted.json" ); - $captureCompleted["CaptureDetails"]["CaptureReferenceId"] = 'AUTHORIZE_123456767'; - $message = new CaptureCompleted( $captureCompleted ); - $this->assertEquals( 'AUTHORIZE_123456767', $message->getOrderId() ); - $action = new ReconstructMerchantReference(); - $action->execute( $message ); - // This ID comes from getOrderReferenceDetails.json - $this->assertEquals( '123456789-0', $message->getOrderId() ); - } - - /** - * Don't waste API calls when it's not an AUTHORIZE_ id - */ - public function testReconstructMerchantIdNotNeeded() { - $captureCompleted = $this->loadJson( __DIR__ . "/../Data/IPN/CaptureCompleted.json" ); - $message = new CaptureCompleted( $captureCompleted ); - $action = new ReconstructMerchantReference(); - $action->execute( $message ); - $this->assertEquals( '98765432-1', $message->getOrderId() ); - $this->assertEmpty( $this->mockClient->calls ); - } -} -- To view, visit https://gerrit.wikimedia.org/r/322810 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id551f7e48da1f44553d8d21a49397a22c3918655 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: deployment Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits