Cdentinger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315678

Change subject: Merge branch 'master' into deployment
......................................................................

Merge branch 'master' into deployment

Fix subscr_cancel error

Deleted tests

Change-Id: I31d16a8a28b00deb28867f5d63736512be0dac8d
---
D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
1 file changed, 0 insertions(+), 135 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/78/315678/1

diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
deleted file mode 100644
index eb34590..0000000
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ /dev/null
@@ -1,135 +0,0 @@
-<<<<<<< HEAD   (28ba03 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;
-
-       // filename and the queue it should get dropped in
-       static $message_data = array(
-               'web_accept.json' => 'verified',
-               'subscr_signup.json' => 'recurring',
-               'subscr_payment.json' => 'recurring',
-               'refund.json' => 'refund'
-       );
-
-       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_data as $file => $type ) {
-                       self::$messages[] = array(
-                               'type' => $type,
-                               'payload' => 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 $msg ) {
-
-                       $this->capture( $msg['payload'] );
-
-                       $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['payload'] );
-               }
-       }
-
-       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 $msg ) {
-                       $this->capture( $msg['payload'] );
-
-                       $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/' . 
$msg['type'] );
-                       $queue->createTable( $msg['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 (bfe49e Fix subscr_cancel error)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31d16a8a28b00deb28867f5d63736512be0dac8d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Cdentinger <cdentin...@wikimedia.org>

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

Reply via email to