Cdentinger has uploaded a new change for review. https://gerrit.wikimedia.org/r/321545
Change subject: Merge branch 'master' into deployment ...................................................................... Merge branch 'master' into deployment + 1a2a99c6a7e632867dc3ebe8825101e75086470d Don't default to now when no date found + 08eaa9fbb1a755b4efc0e0b2deb732f3284835ac Fix silly requeue defaults + a86b5aead9a9b5059f755319cf25c9eb43dbea25 Remove bogus 'inflight' store + d6ed9cc99b0e12873dac236155d58605d9a08ae3 Add some debug logging to queue consumer + a67069a7dd4ac97747cccc8d697d05f782f8992b only add @ to dates if is_numeric + 20b74320d9300c52c41cf9384c2bb71dcabfb586 Return 403 when PP sends us a broken message. Change-Id: Ib1ce8964ac837329b417bf39f145738cd0839dc0 --- D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 1 file changed, 0 insertions(+), 125 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/45/321545/1 diff --git a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php deleted file mode 100644 index 9926d7a..0000000 --- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php +++ /dev/null @@ -1,125 +0,0 @@ -<<<<<<< HEAD (142e60 Merge branch 'master' into deployment) -======= -<?php -namespace SmashPig\PaymentProviders\PayPal\Tests; - -use SmashPig\Core\Configuration; -use SmashPig\Core\Context; -use SmashPig\PaymentProviders\PayPal\Listener; -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. - * @group PayPal - */ -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', - 'chargeback_settlement.json' => 'refund', - // this should not actually get written to - // TODO 'new_case.json' => 'no-op', - ); - - 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; - return $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(); - - if ( $job->is_reject() ) { - $this->assertEmpty( $message ); - } else { - $this->assertNotEmpty( $message ); - if ( isset( $message['contribution_tracking_id'] ) ) { - $this->assertEquals( $message['contribution_tracking_id'], $message['order_id'] ); - } - } - - } - } - - public function testFailedVerification() { - self::$fail_verification = true; - $jobMessage = array( 'txn_type' => 'fail' ); - $this->assertFalse( $this->capture( $jobMessage ) ); - } - -} ->>>>>>> BRANCH (20b743 Return 403 when PP sends us a broken message.) -- To view, visit https://gerrit.wikimedia.org/r/321545 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1ce8964ac837329b417bf39f145738cd0839dc0 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