jenkins-bot has submitted this change and it was merged.
Change subject: Merge branch 'master' into deployment
......................................................................
Merge branch 'master' into deployment
ff080e0 Add order_id to PayPal messages
Change-Id: Ie80f87162020fcf60bf2d17ccf02e379753c8663
---
D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
1 file changed, 0 insertions(+), 132 deletions(-)
Approvals:
Ejegg: Looks good to me, approved
jenkins-bot: Verified
diff --git
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
deleted file mode 100644
index d59979d..0000000
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ /dev/null
@@ -1,132 +0,0 @@
-<<<<<<< HEAD (3811f0 Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\PayPal\Tests;
-
-use SmashPig\Core\Configuration;
-use SmashPig\Core\Context;
-use SmashPig\Core\QueueConsumers\BaseQueueConsumer;
-use SmashPig\PaymentProviders\PayPal\Listener;
-use SmashPig\PaymentProviders\PayPal\Job;
-use SmashPig\PaymentProviders\PayPal\Tests\PayPalTestConfiguration;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-use SmashPig\Core\Http\Response;
-use SmashPig\Core\Http\Request;
-use SmashPig\Core\DataStores\KeyedOpaqueStorableObject;
-
-/**
- * Test the IPN listener which receives messages, stores and processes them.
- */
-class CaptureIncomingMessageTest extends BaseSmashPigUnitTestCase {
-
- /**
- * @var Configuration
- */
- public $config;
-
- static $fail_verification = false;
-
- static $message_locations = array(
- 'verified' => 'web_accept.json',
- 'recurring' => 'subscr_signup.json',
- 'recurring' => 'subscr_payment.json',
- 'refund' => 'refund.json',
- );
-
- static $messages = array();
-
- public function setUp() {
- parent::setUp();
- $this->config = PayPalTestConfiguration::get();
-
- // php-queue\PDO complains about pop() from non-existent table
- $this->config->object( 'data-store/jobs-paypal' )
- ->createTable( 'jobs-paypal' );
-
- Context::initWithLogger( $this->config );
- foreach ( self::$message_locations as $type => $file ) {
- self::$messages[$type] = json_decode(
- file_get_contents( __DIR__ . '/../Data/' .
$file ),
- true
- );
- }
- }
-
- private function capture( $msg ) {
- $request = new Request( $msg );
- $response = new Response;
- $listener = new Listener;
- $listener->execute( $request, $response );
- }
-
- public function testCapture() {
- foreach ( self::$messages as $type => $msg ) {
-
- $this->capture( $msg );
-
- $jobQueue = $this->config->object(
'data-store/jobs-paypal' );
- $jobMessage = $jobQueue->pop();
-
- $this->assertEquals( $jobMessage['php-message-class'],
- 'SmashPig\PaymentProviders\PayPal\Job' );
-
- $this->assertEquals( $jobMessage['payload'], $msg );
-
- }
- }
-
- public function testBlankMessage() {
- $this->capture( array() );
- $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
- $this->assertNull( $jobQueue->pop() );
- }
-
- public function testConsume() {
- foreach ( self::$messages as $type => $msg ) {
- $this->capture( $msg );
-
- $jobQueue = $this->config->object(
'data-store/jobs-paypal' );
- $jobMessage = $jobQueue->pop();
-
- $job = KeyedOpaqueStorableObject::fromJsonProxy(
- $jobMessage['php-message-class'],
- json_encode( $jobMessage )
- );
-
- $job->execute();
-
- $queue = $this->config->object( 'data-store/' . $type );
- $queue->createTable( $type );
- $message = $queue->pop();
-
- $this->assertNotEmpty( $message );
- if ( isset( $message['contribution_tracking_id'] ) ) {
- $this->assertEquals(
$message['contribution_tracking_id'], $message['order_id'] );
- }
-
- }
- }
-
- public function testFailedConsume() {
- self::$fail_verification = true;
- $jobMessage = array( 'txn_type' => 'fail' );
- $jobClass = 'SmashPig\PaymentProviders\PayPal\Job';
- $job = KeyedOpaqueStorableObject::fromJsonProxy(
- $jobClass,
- json_encode( $jobMessage )
- );
-
- try {
- $job->execute();
- } catch ( \Exception $e ) {
- // TODO I think this can throw a special exception to
move to
- // damaged queue or some other stuff
- $this->assertEquals(
-
\SmashPig\PaymentProviders\PayPal\Job::$verifyFailedMsg,
- $e->getMessage()
- );
- }
-
- }
-}
->>>>>>> BRANCH (ff080e Add order_id to PayPal messages)
--
To view, visit https://gerrit.wikimedia.org/r/313542
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie80f87162020fcf60bf2d17ccf02e379753c8663
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits