Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363636 )

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

Merge branch 'master' into deployment

It's a biggie! Needs new config deployed too

f95d5b6 More logging around paypal listener
ad0df32 Maintenance script to batch capture Amazon payments
ecd86f5 Batch cancel Amazon payments
955cfde Smashpig has a config directory, not just one big file
3f0d19e Split provider configuration out of main
306939e Quick path name fix
0e18ef1 Actually split out config classes
8d28cdb Declare reportsClient property explicitly
16935fb Always (re-)initialize logger when setting provider configuration
268a642 Add TestingContext for overriding ProviderConfigurations
545bfb7 Convenience functions to initialize test datastores
604eb24 Add config and test config for payments-init queue
5586bc1 Allow specifying configuration dir with environment vars
b3ad07b Get rid of redundant payment-provider/adyen path
e7c9a45 Config fix: Check provider config for actions node
a1d631e Add gateway_session_id to pending table
780b671 Move CurrencyRates into SmashPig
89983e7 Move NationalCurrencies into SmashPig
286b050 Alert on Amazon message verification failure
8897930 Explicit include path for phpunit bootstrap
fdd1a2c Revert "Add gateway_session_id to pending table"
afdda8e Recover Amazon order IDs when txn captured at console
a0f9fe5 Revert "Allow specifying configuration dir with environment vars"
07840d3 Add missing national currencies, alphabetize
3ad3bd5 Fix Adyen test data generation
756898e Get provider config dir from global config

Change-Id: I0445b229c4723113d505644c26bf77c922542764
---
D PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
D PaymentProviders/Adyen/Tests/BaseAdyenTestCase.php
D PaymentProviders/Adyen/Tests/faker/README
D PaymentProviders/Adyen/Tests/faker/faker.py
D PaymentProviders/Adyen/Tests/faker/templates/pending.json
D PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php
D PaymentProviders/Adyen/Tests/phpunit/CaptureResponseActionTest.php
D PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php
D PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php
D PaymentProviders/Adyen/Tests/phpunit/ReportAvailableTest.php
D PaymentProviders/Adyen/Tests/phpunit/RequeueMessageTest.php
D PaymentProviders/Amazon/Tests/AmazonTestCase.php
D PaymentProviders/Amazon/Tests/AmazonTestConfiguration.php
D PaymentProviders/Amazon/Tests/config_test.yaml
D PaymentProviders/Amazon/Tests/phpunit/AuditTest.php
D PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php
D PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php
D PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php
D PaymentProviders/PayPal/Tests/PayPalTestConfiguration.php
D PaymentProviders/PayPal/Tests/config_test.yaml
D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
D Tests/BaseSmashPigUnitTestCase.php
D Tests/ConfigurationTest.php
D Tests/DamagedDatabaseTest.php
D Tests/FileDumperTest.php
D Tests/PaymentsInitialDatabaseTest.php
D Tests/PendingDatabaseTest.php
D Tests/PendingQueueConsumerTest.php
D Tests/QueueConsumerTest.php
D Tests/SmashPigDatabaseTest.php
D Tests/TestingContext.php
D Tests/TestingDatabase.php
D Tests/TestingGlobalConfiguration.php
D Tests/TestingProviderConfiguration.php
D Tests/bootstrap-phpunit.php
D Tests/data/test_global.yaml
36 files changed, 0 insertions(+), 2,492 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/36/363636/1

diff --git a/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php 
b/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
deleted file mode 100644
index e3191d6..0000000
--- a/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php namespace SmashPig\PaymentProviders\Adyen\Tests;
-
-use SmashPig\Core\GlobalConfiguration;
-use SmashPig\Tests\TestingProviderConfiguration;
-
-class AdyenTestConfiguration extends TestingProviderConfiguration {
-
-       public static function instance( $overrides = array(), 
GlobalConfiguration $globalConfig ) {
-               $config = static::createForProvider( 'adyen', $globalConfig );
-               $config->override( $overrides );
-
-               return $config;
-       }
-
-       public static function createWithSuccessfulApi( GlobalConfiguration 
$globalConfig ) {
-               $override = array( 'api' =>
-                       array(
-                               'class' => 
'SmashPig\PaymentProviders\Adyen\Tests\MockAdyenPaymentsAPI',
-                               'constructor-parameters' =>
-                                       array( 'Success!' )
-                       )
-               );
-               return self::instance( $override, $globalConfig );
-       }
-
-       public static function createWithUnsuccessfulApi( GlobalConfiguration 
$globalConfig ) {
-               $override = array( 'api' =>
-                       array(
-                               'class' => 
'SmashPig\PaymentProviders\Adyen\Tests\MockAdyenPaymentsAPI',
-                               'constructor-parameters' =>
-                                       // FIXME: Really?  or boolean `false` 
as it would be if
-                                       // we parsed "false" from yaml?
-                                       array( 'false' )
-                       )
-               );
-               return self::instance( $override, $globalConfig );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/BaseAdyenTestCase.php 
b/PaymentProviders/Adyen/Tests/BaseAdyenTestCase.php
deleted file mode 100644
index bcf62ef..0000000
--- a/PaymentProviders/Adyen/Tests/BaseAdyenTestCase.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace SmashPig\PaymentProviders\Adyen\Tests;
-
-use SmashPig\Core\Context;
-use SmashPig\Core\ProviderConfiguration;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-class BaseAdyenTestCase extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var ProviderConfiguration
-        */
-       public $config;
-
-       public function setUp() {
-               parent::setUp();
-               $ctx = Context::get();
-               $this->config = AdyenTestConfiguration::createWithSuccessfulApi(
-                       $ctx->getGlobalConfiguration()
-               );
-               $ctx->setProviderConfiguration( $this->config );
-       }
-}
diff --git a/PaymentProviders/Adyen/Tests/faker/README 
b/PaymentProviders/Adyen/Tests/faker/README
deleted file mode 100644
index 81ea522..0000000
--- a/PaymentProviders/Adyen/Tests/faker/README
+++ /dev/null
@@ -1,36 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-Creates matching DonationInterface queue messages and IPN posts
-
-Usage: faker.py 10
-
-Will dump 3 files into the current working directory.
-
-adyen-XXXXX-auths.xml
-adyen-XXXXX-captures.xml
-adyen-XXXXX-pending.json
-
-They will contain 10 messages each, with the same set of randomly generated
-contribution tracking IDs, order IDs, and gateway transaction IDs.
-
-First import the pending queue messages using the SmashPig maintenance script:
-
-~/src/SmashPig$ php Maintenance/PopulateQueueFromDump.php --queue pending 
adyen-12345-pending.json
-
-And move them from the pending queue to the pending table in your smashpig db.
-~/src/SmashPig$ php Maintenance/ConsumePendingQueue.php
-
-Then use the soap injector to simulate some IPN messages for the 
authorizations:
-~/src/SmashPig/Tests/SoapInjector$ ./soapinject.py localhost 
'/ipn/smashpig_http_handler.php?p=adyen/listener' ../../adyen-12345-auths.xml
-
-This should queue up some capture request jobs. Run them like this:
-
-~/src/SmashPig$ php Maintenance/QueueJobRunner.php --queue jobs-adyen 
--config-node adyen
-TODO: fake API endpoint
-
-Then inject some capture success messages
-~/src/SmashPig/Tests/SoapInjector$ ./soapinject.py localhost 
'/ipn/smashpig_http_handler.php?p=adyen/listener' ../../adyen-12345-captures.xml
-
-This should queue up jobs to record the successful captures. Execute the job
-runner again and it should move the donor information into the Civi queue.
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/faker/faker.py 
b/PaymentProviders/Adyen/Tests/faker/faker.py
deleted file mode 100755
index 5ed0006..0000000
--- a/PaymentProviders/Adyen/Tests/faker/faker.py
+++ /dev/null
@@ -1,55 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-#!/usr/bin/env python
-# -*- coding: UTF-8 -*-
-import re
-import sys 
-import random
-import os
-
-if len(sys.argv) > 1:
-    num = int(sys.argv[1]);
-else:
-    num = 5;
-
-templatedir = os.path.dirname(os.path.realpath(__file__)) + '/templates/'
-
-with open(templatedir + 'ipnContainer.xml', 'r') as myfile:
-    ipnContainer = myfile.read()
-
-with open(templatedir + 'auth.xml', 'r') as myfile:
-    auth = myfile.read()
-
-with open(templatedir + 'capture.xml', 'r') as myfile:
-    capture = myfile.read()
-
-with open(templatedir + 'pending.json', 'r') as myfile:
-    pending = myfile.read()
-
-auths = ''
-captures = ''
-pqueue = ''
-
-fileprefix = 'adyen-' + str(random.randint(10000,100000))
-
-for x in range(0, num):
-    ctid = str(random.randint(100000,1000000))
-    oid = ctid + '.' + str(random.randint(0,4))
-    authid = str(random.randint(100000000000,1000000000000))
-    captureid = str(random.randint(100000000000,1000000000000))
-    header = 'adyen-'  + oid
-    pqueue += pending.replace('[[CTID]]', ctid).replace('[[ORDERID]]', oid)
-    auths += auth.replace('[[ORDERID]]', oid).replace('[[AUTHID]]', authid)
-    captures += capture.replace('[[ORDERID]]', oid).replace('[[AUTHID]]', 
authid).replace('[[CAPTUREID]]', captureid)
-
-with open(fileprefix + '-auths.xml', 'w') as myfile:
-    myfile.write( ipnContainer.replace('[[ITEMS]]', auths ))
-
-with open(fileprefix + '-captures.xml', 'w') as myfile:
-    myfile.write( ipnContainer.replace('[[ITEMS]]', captures ))
-
-with open(fileprefix + '-pending.json', 'w') as myfile:
-    myfile.write( pqueue )
-
-print('Dumped {0} fake donations in your lap. Bon appétit!'.format(num))
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/faker/templates/pending.json 
b/PaymentProviders/Adyen/Tests/faker/templates/pending.json
deleted file mode 100644
index fc5a5f6..0000000
--- a/PaymentProviders/Adyen/Tests/faker/templates/pending.json
+++ /dev/null
@@ -1,4 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-{"source_host":"lakitu","source_enqueued_time":"1458060070","source_type":"payments","source_version":"unknown","source_run_id":"2027","source_name":"DonationInterface","contribution_tracking_id":"[[CTID]]","country":"US","order_id":"[[ORDERID]]","date":1458060070,"email":"test[[CTID]]@example.com","fee":"0","gateway_account":"WikimediaCOM","gateway":"adyen","gateway_txn_id":false,"language":"en","payment_method":"cc","payment_submethod":"visa","response":false,"user_ip":"127.0.0.1","utm_source":"..cc","city":"Columbus","currency":"USD","first_name":"Testy[[CTID]]","gross":"10.00","last_name":"Testerson[[CTID]]","recurring":"","risk_score":10,"state_province":"OH","street_address":"123
 Fake St","utm_campaign":"","utm_medium":"","postal_code":"12345"}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php 
b/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php
deleted file mode 100644
index 68a71a9..0000000
--- a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php
+++ /dev/null
@@ -1,235 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php namespace SmashPig\PaymentProviders\Adyen\Test;
-
-use PHPQueue\Backend\PDO;
-use SmashPig\Core\Context;
-use SmashPig\Core\DataStores\JsonSerializableObject;
-use SmashPig\Core\DataStores\PendingDatabase;
-use SmashPig\Core\DataStores\QueueWrapper;
-use SmashPig\Core\ProviderConfiguration;
-use SmashPig\PaymentProviders\Adyen\Jobs\ProcessCaptureRequestJob;
-use SmashPig\PaymentProviders\Adyen\Tests\AdyenTestConfiguration;
-use SmashPig\PaymentProviders\Adyen\Tests\BaseAdyenTestCase;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * Verify Adyen Capture job functions
- *
- * @group Adyen
- */
-class CaptureJobTest extends BaseAdyenTestCase {
-       /**
-        * @var PendingDatabase
-        */
-       protected $pendingDatabase;
-       protected $pendingMessage;
-       /**
-        * @var PDO
-        */
-       protected $antifraudQueue;
-
-       public function setUp() {
-               parent::setUp();
-
-               $this->pendingDatabase = PendingDatabase::get();
-               $this->pendingMessage = json_decode(
-                       file_get_contents( __DIR__ . '/../Data/pending.json' ) 
, true
-               );
-               $this->pendingDatabase->storeMessage( $this->pendingMessage );
-               $this->antifraudQueue = QueueWrapper::getQueue( 
'payments-antifraud' );
-       }
-
-       public function tearDown() {
-               $this->pendingDatabase->deleteMessage( $this->pendingMessage );
-               parent::tearDown();
-       }
-
-       /**
-        * For a legit donation, ProcessCaptureJob should leave donor data
-        * in the pending database, add an antifraud message, and return true.
-        */
-       public function testSuccessfulCapture() {
-               $api = $this->config->object( 'api', true );
-
-               $auth = JsonSerializableObject::fromJsonProxy(
-                       
'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation',
-                       file_get_contents( __DIR__ . '/../Data/auth.json' )
-               );
-
-               $job = ProcessCaptureRequestJob::factory( $auth );
-               $this->assertTrue( $job->execute() );
-
-               $donorData = 
$this->pendingDatabase->fetchMessageByGatewayOrderId(
-                       'adyen', $auth->merchantReference
-               );
-
-               $this->assertNotNull(
-                       $donorData,
-                       'RequestCaptureJob did not leave donor data on pending 
queue'
-               );
-               $this->assertTrue(
-                       $donorData['captured'],
-                       'RequestCaptureJob did not mark donor data as captured'
-               );
-
-               $this->assertEquals(
-                       array(
-                               'currency' => 'USD',
-                               'amount' => 10,
-                               'pspReference' => '762895314225',
-                       ),
-                       $api->captured[0],
-                       'RequestCaptureJob did not make the right capture call'
-               );
-
-               $antifraudMessage = $this->antifraudQueue->pop();
-               $this->assertNotNull(
-                       $antifraudMessage,
-                       'RequestCaptureJob did not send antifraud message'
-               );
-               $this->assertEquals(
-                       'process',
-                       $antifraudMessage['validation_action'],
-                       'Successful capture should get "process" validation 
action'
-               );
-       }
-
-       /**
-        * When AVS and CVV scores push the donation over the review threshold,
-        * we should not capture the payment, but leave the donor details.
-        */
-       public function testReviewThreshold() {
-               $api = $this->config->object( 'api', true );
-
-               $auth = JsonSerializableObject::fromJsonProxy(
-                       
'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation',
-                       file_get_contents( __DIR__ . '/../Data/auth.json' )
-               );
-
-               $auth->avsResult = '1'; // Bad zip code pushes us over review
-
-               $job = ProcessCaptureRequestJob::factory( $auth );
-               $this->assertTrue( $job->execute() );
-
-               $donorData = 
$this->pendingDatabase->fetchMessageByGatewayOrderId(
-                       'adyen', $auth->merchantReference
-               );
-               $this->assertNotNull(
-                       $donorData,
-                       'RequestCaptureJob did not leave donor data for review'
-               );
-               $this->assertTrue(
-                       empty( $donorData['captured'] ),
-                       'RequestCaptureJob marked donor data above review 
threshold as captured'
-               );
-
-               $this->assertEmpty(
-                       $api->captured,
-                       'RequestCaptureJob tried to capture above review 
threshold'
-               );
-
-               $antifraudMessage = $this->antifraudQueue->pop();
-               $this->assertNotNull(
-                       $antifraudMessage,
-                       'RequestCaptureJob did not send antifraud message'
-               );
-               $this->assertEquals(
-                       'review',
-                       $antifraudMessage['validation_action'],
-                       'Suspicious auth should get "review" validation action'
-               );
-       }
-
-       /**
-        * When AVS and CVV scores push the donation over the reject threshold,
-        * we should cancel the authorization and delete the donor details.
-        */
-       public function testRejectThreshold() {
-               $api = $this->config->object( 'api', true );
-
-               $auth = JsonSerializableObject::fromJsonProxy(
-                       
'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation',
-                       file_get_contents( __DIR__ . '/../Data/auth.json' )
-               );
-
-               $auth->avsResult = '2'; // No match at all
-               $auth->cvvResult = '2'; // CVV is also wrong
-
-               $job = ProcessCaptureRequestJob::factory( $auth );
-               $this->assertTrue( $job->execute() );
-
-               $donorData = 
$this->pendingDatabase->fetchMessageByGatewayOrderId(
-                       'adyen', $auth->merchantReference
-               );
-               $this->assertNull(
-                       $donorData,
-                       'RequestCaptureJob should delete fraudy donor data'
-               );
-
-               $this->assertEmpty(
-                       $api->captured,
-                       'RequestCaptureJob tried to capture above reject 
threshold'
-               );
-               $this->assertEquals(
-                       $auth->pspReference,
-                       $api->cancelled[0],
-                       'Did not cancel the fraudulent authorization'
-               );
-
-               $antifraudMessage = $this->antifraudQueue->pop();
-               $this->assertNotNull(
-                       $antifraudMessage,
-                       'RequestCaptureJob did not send antifraud message'
-               );
-               $this->assertEquals(
-                       'reject',
-                       $antifraudMessage['validation_action'],
-                       'Obvious fraud should get "reject" validation action'
-               );
-       }
-
-       /**
-        * When two authorizations come in with the same merchant reference, we
-        * should cancel the second one and leave the donor details in pending.
-        */
-       public function testDuplicateAuthorisation() {
-               $api = $this->config->object( 'api', true );
-
-               $auth1 = JsonSerializableObject::fromJsonProxy(
-                       
'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation',
-                       file_get_contents( __DIR__ . '/../Data/auth.json' )
-               );
-               $job1 = ProcessCaptureRequestJob::factory( $auth1 );
-               $job1->execute();
-
-               $this->assertEquals( 1, count( $api->captured ), 'Set up 
failed' );
-
-               $auth2 = JsonSerializableObject::fromJsonProxy(
-                       
'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation',
-                       file_get_contents( __DIR__ . '/../Data/auth.json' )
-               );
-               $auth2->pspReference = mt_rand( 1000000000, 10000000000 );
-               $job2 = ProcessCaptureRequestJob::factory( $auth2 );
-               $this->assertTrue(
-                       $job2->execute(),
-                       'Duplicate auths should not clutter damage queue'
-               );
-
-               $this->assertEquals( 1, count( $api->captured ), 'Captured a 
duplicate!' );
-               $this->assertEquals(
-                       $auth2->pspReference,
-                       $api->cancelled[0],
-                       'Did not cancel the right authorization'
-               );
-
-               $this->assertNotNull(
-                       $this->pendingDatabase->fetchMessageByGatewayOrderId(
-                               'adyen', $auth1->merchantReference
-                       ),
-                       'Capture job should leave donor details in database'
-               );
-       }
-
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/phpunit/CaptureResponseActionTest.php 
b/PaymentProviders/Adyen/Tests/phpunit/CaptureResponseActionTest.php
deleted file mode 100644
index 74e1994..0000000
--- a/PaymentProviders/Adyen/Tests/phpunit/CaptureResponseActionTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\Adyen\Tests;
-
-use PHPQueue\Interfaces\FifoQueueStore;
-use SmashPig\Core\Context;
-use SmashPig\PaymentProviders\Adyen\Actions\CaptureResponseAction;
-use SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Capture;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * @group Adyen
- */
-class CaptureResponseActionTest extends BaseAdyenTestCase {
-
-       /**
-        * @var FifoQueueStore
-        */
-       protected $jobQueue;
-
-       public function setUp() {
-               parent::setUp();
-               $this->jobQueue = Context::get()->getGlobalConfiguration()
-                       ->object( 'data-store/jobs-adyen' );
-       }
-
-       public function testSuccessfulCapture() {
-               $capture = new Capture();
-               $capture->success = true;
-
-               $capture->merchantAccountCode = 'WikimediaTest';
-               $capture->currency = 'USD';
-               $capture->amount = 10.00;
-               $capture->originalReference = mt_rand();
-               $capture->merchantReference = mt_rand();
-
-               $action = new CaptureResponseAction();
-               $action->execute( $capture );
-
-               $job = $this->jobQueue->pop();
-
-               $this->assertEquals(
-                       'SmashPig\PaymentProviders\Adyen\Jobs\RecordCaptureJob',
-                       $job['php-message-class']
-               );
-               $sameProps = array(
-                       'currency', 'amount', 'originalReference', 
'merchantReference'
-               );
-               foreach ( $sameProps as $prop ) {
-                       $this->assertEquals(
-                               $capture->$prop,
-                               $job[$prop],
-                               "Job property $prop does not match capture"
-                       );
-               }
-       }
-
-       public function testFailedCapture() {
-               $capture = new Capture();
-               $capture->success = false;
-
-               $action = new CaptureResponseAction();
-               $action->execute( $capture );
-
-               $job = $this->jobQueue->pop();
-
-               $this->assertNull( $job, 'Should not have queued a job' );
-       }
-
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php 
b/PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php
deleted file mode 100644
index 48eb326..0000000
--- a/PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\Adyen\Tests;
-
-use PHPQueue\Interfaces\FifoQueueStore;
-use SmashPig\Core\Context;
-use SmashPig\PaymentProviders\Adyen\Actions\PaymentCaptureAction;
-use SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * @group Adyen
- */
-class PaymentCaptureActionTest extends BaseAdyenTestCase {
-
-       /**
-        * @var FifoQueueStore
-        */
-       protected $jobQueue;
-
-       public function setUp() {
-               parent::setUp();
-               $globalConfig = Context::get()->getGlobalConfiguration();
-               $this->jobQueue = $globalConfig->object( 
'data-store/jobs-adyen' );
-       }
-
-       public function testSuccessfulAuth() {
-               $auth = new Authorisation();
-               $auth->success = true;
-               $auth->merchantAccountCode = 'WikimediaTest' ;
-               $auth->currency = 'USD';
-               $auth->amount = '10';
-               $auth->merchantReference = mt_rand();
-               $auth->pspReference = mt_rand();
-               $auth->cvvResult = 1;
-               $auth->avsResult = 19;
-
-               $action = new PaymentCaptureAction();
-               $action->execute( $auth );
-
-               $job = $this->jobQueue->pop();
-
-               $this->assertEquals(
-                       
'SmashPig\PaymentProviders\Adyen\Jobs\ProcessCaptureRequestJob',
-                       $job['php-message-class']
-               );
-               $sameProps = array(
-                       'currency', 'amount', 'pspReference', 
'merchantReference',
-                       'avsResult', 'cvvResult',
-
-               );
-               foreach ( $sameProps as $prop ) {
-                       $this->assertEquals(
-                               $auth->$prop,
-                               $job[$prop],
-                               "Job property $prop does not match capture"
-                       );
-               }
-       }
-
-       public function testFailedAuth() {
-               $auth = new Authorisation();
-               $auth->success = false;
-               $auth->merchantAccountCode = 'WikimediaTest' ;
-               $auth->merchantReference = mt_rand();
-
-               $action = new PaymentCaptureAction();
-               $action->execute( $auth );
-
-               $job = $this->jobQueue->pop();
-
-               $this->assertEquals(
-                       'SmashPig\Core\Jobs\DeletePendingJob',
-                       $job['php-message-class']
-               );
-               $this->assertEquals(
-                       $auth->merchantReference,
-                       $job['order_id']
-               );
-               $this->assertEquals( 'adyen', $job['gateway'] );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php 
b/PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php
deleted file mode 100644
index f24a366..0000000
--- a/PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php namespace SmashPig\PaymentProviders\Adyen\Test;
-
-use SmashPig\Core\Context;
-use SmashPig\Core\DataStores\JsonSerializableObject;
-use SmashPig\Core\DataStores\PendingDatabase;
-use SmashPig\Core\DataStores\QueueWrapper;
-use SmashPig\PaymentProviders\Adyen\Jobs\RecordCaptureJob;
-use SmashPig\PaymentProviders\Adyen\Tests\AdyenTestConfiguration;
-use SmashPig\PaymentProviders\Adyen\Tests\BaseAdyenTestCase;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * Verify Adyen RecordCapture job functions
- *
- * @group Adyen
- */
-class RecordCaptureJobTest extends BaseAdyenTestCase {
-
-       /**
-        * @var PendingDatabase
-        */
-       protected $pendingDatabase;
-       protected $pendingMessage;
-
-       public function setUp() {
-               parent::setUp();
-               $this->pendingDatabase = PendingDatabase::get();
-               $this->pendingMessage = json_decode(
-                       file_get_contents( __DIR__ . '/../Data/pending.json' ) 
, true
-               );
-               $this->pendingMessage['captured'] = true;
-               $this->pendingDatabase->storeMessage( $this->pendingMessage );
-       }
-
-       public function tearDown() {
-               $this->pendingDatabase->deleteMessage( $this->pendingMessage );
-               parent::tearDown();
-       }
-
-       public function testRecordCapture() {
-               $donationsQueue = QueueWrapper::getQueue( 'donations' );
-               $capture = JsonSerializableObject::fromJsonProxy(
-                       
'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Capture',
-                       file_get_contents( __DIR__ . '/../Data/capture.json' )
-               );
-
-               $job = RecordCaptureJob::factory( $capture );
-               $this->assertTrue( $job->execute() );
-
-               $donorData = 
$this->pendingDatabase->fetchMessageByGatewayOrderId(
-                       'adyen', $capture->merchantReference
-               );
-
-               $this->assertNull(
-                       $donorData,
-                       'RecordCaptureJob left donor data on pending queue'
-               );
-
-               $donationMessage = $donationsQueue->pop();
-               $this->assertNotNull(
-                       $donationMessage,
-                       'RecordCaptureJob did not send donation message'
-               );
-               // can we use arraySubset yet?
-               $sameKeys = array_intersect(
-                       array_keys( $donationMessage ),
-                       array_keys( $this->pendingMessage )
-               );
-               foreach ( $sameKeys as $key ) {
-                       if ( $key === 'gateway_txn_id' ) {
-                               $this->assertEquals(
-                                       $capture->originalReference, 
$donationMessage[$key],
-                                       'RecordCaptureJob should have set 
gateway_txn_id'
-                               );
-                       } else {
-                               $this->assertEquals(
-                                       $this->pendingMessage[$key],
-                                       $donationMessage[$key],
-                                       "Value of key $key mutated"
-                               );
-                       }
-               }
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/phpunit/ReportAvailableTest.php 
b/PaymentProviders/Adyen/Tests/phpunit/ReportAvailableTest.php
deleted file mode 100644
index 1a4ec95..0000000
--- a/PaymentProviders/Adyen/Tests/phpunit/ReportAvailableTest.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\Adyen\Tests;
-
-use PHPQueue\Interfaces\FifoQueueStore;
-use SmashPig\Core\Context;
-use SmashPig\Core\DataStores\QueueWrapper;
-use SmashPig\Core\UtcDate;
-use SmashPig\CrmLink\Messages\SourceFields;
-use SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\ReportAvailable;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * @group Adyen
- */
-class ReportAvailableTest extends BaseAdyenTestCase {
-       /**
-        * @var FifoQueueStore
-        */
-       protected $jobQueue;
-
-       public function setUp() {
-               parent::setUp();
-               $this->jobQueue = QueueWrapper::getQueue( 'jobs-adyen' );
-       }
-
-       public function testReportAvailable() {
-               $filename = 'settlement_detail_report_2016_10_13.csv';
-               $account = 'WikimediaTest';
-               $url = 
"https://example.com/reports/download/MerchantAccount/$account/$filename";;
-               $reportAvailable = new ReportAvailable();
-
-               $reportAvailable->merchantAccountCode = $account;
-               $reportAvailable->merchantReference = mt_rand();
-               $reportAvailable->pspReference = $filename;
-               $reportAvailable->reason = $url;
-               $reportAvailable->eventDate = '2016-10-14T12:06:20.496+02:00';
-
-               $reportAvailable->runActionChain();
-
-               $job = $this->jobQueue->pop();
-
-               $now = UtcDate::getUtcTimestamp();
-               $diff = abs( $job['source_enqueued_time'] ) - $now;
-               $this->assertTrue( $diff < 60, 'Odd enqueued time' );
-               SourceFields::removeFromMessage( $job );
-               unset( $job['propertiesExcludedFromExport'] );
-               $expected = array(
-                       'php-message-class' => 
'SmashPig\PaymentProviders\Adyen\Jobs\DownloadReportJob',
-                       'reportUrl' => $url,
-                       'account' => $account,
-                       'gateway' => 'adyen',
-               );
-               $this->assertEquals( $expected, $job );
-       }
-
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Adyen/Tests/phpunit/RequeueMessageTest.php 
b/PaymentProviders/Adyen/Tests/phpunit/RequeueMessageTest.php
deleted file mode 100644
index bf41087..0000000
--- a/PaymentProviders/Adyen/Tests/phpunit/RequeueMessageTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php namespace SmashPig\PaymentProviders\Adyen\Test;
-
-use SmashPig\Core\Context;
-use SmashPig\Core\DataStores\JsonSerializableObject;
-use SmashPig\Core\DataStores\PendingDatabase;
-use SmashPig\PaymentProviders\Adyen\Jobs\ProcessCaptureRequestJob;
-use SmashPig\PaymentProviders\Adyen\Tests\AdyenTestConfiguration;
-use SmashPig\PaymentProviders\Adyen\Tests\BaseAdyenTestCase;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * Make sure a message that arrives before the pending databases entry gets
- * written is properly requeued for retry.
- *
- * @group Adyen
- */
-class RequeueMessageTest extends BaseAdyenTestCase {
-
-       /**
-        * @expectedException \SmashPig\Core\RetryableException
-        */
-       public function testRequeueMessage() {
-
-               $auth = JsonSerializableObject::fromJsonProxy(
-                       
'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation',
-                       file_get_contents( __DIR__ . '/../Data/auth.json' )
-               );
-
-               $job = ProcessCaptureRequestJob::factory( $auth );
-               $job->execute();
-
-       }
-
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Amazon/Tests/AmazonTestCase.php 
b/PaymentProviders/Amazon/Tests/AmazonTestCase.php
deleted file mode 100644
index f882c05..0000000
--- a/PaymentProviders/Amazon/Tests/AmazonTestCase.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?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
-               $ctx = Context::get();
-               $config = AmazonTestConfiguration::instance( 
$ctx->getGlobalConfiguration() );
-               $ctx->setProviderConfiguration( $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 );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Amazon/Tests/AmazonTestConfiguration.php 
b/PaymentProviders/Amazon/Tests/AmazonTestConfiguration.php
deleted file mode 100644
index 6a1dd1c..0000000
--- a/PaymentProviders/Amazon/Tests/AmazonTestConfiguration.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\PaymentProviders\Amazon\Tests;
-
-use SmashPig\Core\GlobalConfiguration;
-use SmashPig\Tests\TestingProviderConfiguration;
-
-class AmazonTestConfiguration extends TestingProviderConfiguration {
-
-       public static function instance( GlobalConfiguration $globalConfig ) {
-               return self::createForProviderWithOverrideFile(
-                       'amazon',
-                       __DIR__ . '/config_test.yaml',
-                       $globalConfig
-               );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Amazon/Tests/config_test.yaml 
b/PaymentProviders/Amazon/Tests/config_test.yaml
deleted file mode 100644
index d8c1e4b..0000000
--- a/PaymentProviders/Amazon/Tests/config_test.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-payments-client:
-    class: PayWithAmazon\Mocks\MockPaymentsClient
-    constructor-parameters:
-        - response-directory: ./Data/responses
-
-reports-client:
-    class: PayWithAmazon\Mocks\MockReportsClient
-    constructor-parameters:
-        - response-directory: ./Data/responses
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Amazon/Tests/phpunit/AuditTest.php 
b/PaymentProviders/Amazon/Tests/phpunit/AuditTest.php
deleted file mode 100644
index fa465bb..0000000
--- a/PaymentProviders/Amazon/Tests/phpunit/AuditTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\Amazon\Tests;
-
-use SmashPig\Core\Context;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-use SmashPig\PaymentProviders\Amazon\Audit\AuditParser;
-
-/**
- * Verify Amazon audit file processor functions
- */
-class AuditTest extends BaseSmashPigUnitTestCase {
-       public function setUp() {
-               parent::setUp();
-               $ctx = Context::get();
-               $config = AmazonTestConfiguration::instance( 
$ctx->getGlobalConfiguration() );
-               $ctx->setProviderConfiguration( $config );
-       }
-
-       /**
-        * Normal donation
-        */
-       public function testProcessDonation() {
-               $processor = new AuditParser();
-               $output = $processor->parseFile( __DIR__ . 
'/../Data/audit/2015-10-01-SETTLEMENT_DATA_371273040777777.csv' );
-               $this->assertEquals( 1, count( $output ), 'Should have found 
one donation' );
-               $actual = $output[0];
-               $expected = array(
-                       'gateway' => 'amazon',
-                       'date' => 1443723034,
-                       'gross' => '10.00',
-                       'contribution_tracking_id' => '87654321',
-                       'currency' => 'USD',
-                       'gateway_txn_id' => 'P01-1488694-1234567-C034811',
-                       'log_id' => '87654321-0',
-                       'payment_method' => 'amazon',
-                       'fee' => '0.59',
-               );
-               $this->assertEquals( $expected, $actual, 'Did not parse 
donation correctly' );
-       }
-
-       /**
-        * Now try a refund
-        */
-       public function testProcessRefund() {
-               $processor = new AuditParser();
-               $output = $processor->parseFile( __DIR__ . 
'/../Data/audit/2015-10-06-REFUND_DATA_414749300022222.csv' );
-               $this->assertEquals( 1, count( $output ), 'Should have found 
one refund' );
-               $actual = $output[0];
-               $expected = array(
-                       'gateway' => 'amazon',
-                       'date' => 1444087249,
-                       'gross' => '1.00',
-                       'gateway_parent_id' => 'P01-4968629-7654321-C070794',
-                       'gross_currency' => 'USD',
-                       'type' => 'refund',
-                       'gateway_refund_id' => 'P01-4968629-7654321-R017571',
-               );
-               $this->assertEquals( $expected, $actual, 'Did not parse refund 
correctly' );
-       }
-
-       /**
-        * And a chargeback
-        */
-       public function testProcessChargeback() {
-               $processor = new AuditParser();
-               $output = $processor->parseFile( __DIR__ . 
'/../Data/audit/2015-10-06-REFUND_DATA_414749300033333.csv' );
-               $this->assertEquals( 1, count( $output ), 'Should have found 
one chargeback' );
-               $actual = $output[0];
-               $expected = array(
-                       'gateway' => 'amazon',
-                       'date' => 1444087249,
-                       'gross' => '1.00',
-                       'gateway_parent_id' => 'P01-4968629-2345678-C070794',
-                       'gross_currency' => 'USD',
-                       'gateway_refund_id' => 'P01-4968629-2345678-R017571',
-                       'type' => 'chargeback',
-               );
-               $this->assertEquals( $expected, $actual, 'Did not parse 
chargeback correctly' );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php 
b/PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php
deleted file mode 100644
index ea39eb3..0000000
--- a/PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\PaymentProviders\Ingenico\Tests;
-
-use DateTime;
-use PHPUnit_Framework_MockObject_MockObject;
-use SmashPig\PaymentProviders\Ingenico\Api;
-use SmashPig\PaymentProviders\Ingenico\Authenticator;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * @group Ingenico
- */
-class ApiTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var PHPUnit_Framework_MockObject_MockObject
-        */
-       protected $curlWrapper;
-
-       /**
-        * @var Authenticator
-        */
-       protected $authenticator;
-
-       /**
-        * @var Api
-        */
-       protected $api;
-
-       public function setUp() {
-               parent::setUp();
-               $providerConfiguration = $this->setProviderConfiguration( 
'ingenico' );
-               $this->curlWrapper = $this->getMock( 
'\SmashPig\Core\Http\CurlWrapper' );
-               $providerConfiguration->overrideObjectInstance( 'curl/wrapper', 
$this->curlWrapper );
-
-               $this->authenticator = new Authenticator(
-                       '5e45c937b9db33ae',
-                       'I42Zf4pVnRdroHfuHnRiJjJ2B6+22h0yQt/R3nZR8Xg='
-               );
-               $this->api = new Api(
-                       'https://example.com',
-                       '9876'
-               );
-       }
-
-       public function testCreateRequest() {
-               $headerVerification = function( $headers ) {
-                       $date = new DateTime( $headers['Date'] );
-                       return $date !== null &&
-                               $headers['Content-Type'] === 'application/json';
-               };
-
-               $this->curlWrapper->expects( $this->once() )
-                       ->method( 'execute' )
-                       ->with(
-                               $this->equalTo( 
'https://example.com/v1/9876/testPath' ),
-                               $this->equalTo( 'POST' ),
-                               $this->callback( $headerVerification ),
-                               $this->equalTo( '{"foo":"bar"}' )
-                       )->willReturn( array(
-                               'body' => '{"baz":"quux"}'
-                       ) );
-
-               $this->api->makeApiCall( 'testPath', 'POST', array( 'foo' => 
'bar' ) );
-       }
-
-       /**
-        * @expectedException SmashPig\PaymentProviders\Ingenico\ApiException
-        * @expectedExceptionMessage Ingenico error id 
460d9c9c-098c-4d84-b1e5-ee27ec601757. Error code 9002: 
MISSING_OR_INVALID_AUTHORIZATION
-        */
-       public function testError() {
-               $this->curlWrapper->method( 'execute' )
-                       ->willReturn( array(
-                               'body' => '{"errorId" : 
"460d9c9c-098c-4d84-b1e5-ee27ec601757","errors" : [ {   "code" : "9002",   
"message" : "MISSING_OR_INVALID_AUTHORIZATION",   "httpStatusCode" : 403} ] }',
-                               'headers' => array(),
-                               'status' => 403
-                       ) );
-               $this->api->makeApiCall( 'testPath', 'POST', array( 'foo' => 
'bar' ) );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git 
a/PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php 
b/PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php
deleted file mode 100644
index 94946e2..0000000
--- a/PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php
+++ /dev/null
@@ -1,130 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\Ingenico\Tests;
-
-use PHPUnit_Framework_MockObject_MockObject;
-use Psr\Cache\CacheItemPoolInterface;
-use SmashPig\Core\Cache\HashCacheItem;
-use SmashPig\Core\Context;
-use SmashPig\Core\Http\CurlWrapper;
-use SmashPig\PaymentProviders\Ingenico\BankPaymentProvider;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * @group Ingenico
- */
-class BankPaymentProviderTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var PHPUnit_Framework_MockObject_MockObject
-        */
-       protected $curlWrapper;
-
-       /**
-        * @var BankPaymentProvider
-        */
-       protected $provider;
-
-       /**
-        * @var CacheItemPoolInterface
-        */
-       protected $cache;
-
-       public function setUp() {
-               parent::setUp();
-
-               $providerConfiguration = $this->setProviderConfiguration( 
'ingenico' );
-               $this->curlWrapper = $this->getMock( 
'\SmashPig\Core\Http\CurlWrapper' );
-               $providerConfiguration->overrideObjectInstance( 'curl/wrapper', 
$this->curlWrapper );
-
-               $globalConfig = Context::get()->getGlobalConfiguration();
-               $this->cache = $globalConfig->object( 'cache', true );
-               $this->cache->clear();
-
-               $this->provider = new BankPaymentProvider( array(
-                       'cache-parameters' => array(
-                               'duration' => 10,
-                               'key-base' => 'BLAH_BLAH'
-                       )
-               ) );
-       }
-
-       public function testGetBankList() {
-               $this->setUpResponse( 'productDirectory', 200 );
-               $results = $this->provider->getBankList( 'NL', 'EUR' );
-               $this->assertEquals(
-                       array(
-                               'INGBNL2A' => 'Issuer Simulation V3 - ING'
-                       ),
-                       $results
-               );
-       }
-
-       public function testCacheBankList() {
-               $this->setUpResponse( 'productDirectory', 200 );
-               $this->curlWrapper->expects( $this->once() )
-                       ->method( 'execute' );
-               $results = $this->provider->getBankList( 'NL', 'EUR' );
-               $this->assertEquals(
-                       array(
-                               'INGBNL2A' => 'Issuer Simulation V3 - ING'
-                       ),
-                       $results
-               );
-               $cachedResults = $this->provider->getBankList( 'NL', 'EUR' );
-               $this->assertEquals( $results, $cachedResults );
-       }
-
-       /**
-        * When the lookup returns 404 we should cache the emptiness
-        */
-       public function testCacheEmptyBankList() {
-               $this->setUpResponse( 'emptyDirectory', 404 );
-               $this->curlWrapper->expects( $this->once() )
-                       ->method( 'execute' );
-               $results = $this->provider->getBankList( 'NL', 'COP' );
-               $this->assertEquals( array(), $results );
-               $cached = $this->cache->getItem( 'BLAH_BLAH_NL_COP_809' );
-               $this->assertTrue( $cached->isHit() );
-               $again = $this->provider->getBankList( 'NL', 'COP' );
-               $this->assertEquals( $results, $again );
-       }
-
-       public function testBustedCacheExpiration() {
-               $cacheItem = new HashCacheItem(
-                       'BLAH_BLAH_NL_EUR_809',
-                       array(
-                               'value' => array( 'STALE' => 'NotValid' ),
-                               'expiration' => time() - 100
-                       ),
-                       true
-               );
-               $this->cache->save( $cacheItem );
-               $this->setUpResponse( 'productDirectory', 200 );
-               $this->curlWrapper->expects( $this->once() )
-                       ->method( 'execute' );
-               $results = $this->provider->getBankList( 'NL', 'EUR' );
-               $this->assertEquals(
-                       array(
-                               'INGBNL2A' => 'Issuer Simulation V3 - ING'
-                       ),
-                       $results
-               );
-       }
-
-       /**
-        * @param string $filename Name of a file in ../Data representing a
-        *  response (headers, blank line, body), which must use dos-style
-        *  \r\n line endings.
-        * @param integer $statusCode
-        */
-       protected function setUpResponse( $filename, $statusCode ) {
-               $contents = file_get_contents( __DIR__ . 
"/../Data/$filename.response" );
-               $parsed = CurlWrapper::parseResponse(
-                       $contents, array( 'http_code' => $statusCode )
-               );
-               $this->curlWrapper->method( 'execute' )->willReturn( $parsed );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git 
a/PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php 
b/PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php
deleted file mode 100644
index 7634996..0000000
--- a/PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\Ingenico\Tests;
-
-use PHPUnit_Framework_MockObject_MockObject;
-use Psr\Cache\CacheItemPoolInterface;
-use SmashPig\Core\Context;
-use SmashPig\Core\Http\CurlWrapper;
-use SmashPig\PaymentProviders\Ingenico\IdealStatusProvider;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-
-/**
- * @group Ingenico
- */
-class IdealStatusProviderTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var PHPUnit_Framework_MockObject_MockObject
-        */
-       protected $curlWrapper;
-
-       /**
-        * @var IdealStatusProvider
-        */
-       protected $provider;
-
-       /**
-        * @var CacheItemPoolInterface
-        */
-       protected $cache;
-
-       public function setUp() {
-               parent::setUp();
-
-               $providerConfiguration = $this->setProviderConfiguration( 
'ingenico' );
-               $this->curlWrapper = $this->getMock( 
'\SmashPig\Core\Http\CurlWrapper' );
-               $providerConfiguration->overrideObjectInstance( 'curl/wrapper', 
$this->curlWrapper );
-
-               $globalConfig = Context::get()->getGlobalConfiguration();
-               $this->cache = $globalConfig->object( 'cache', true );
-               $this->cache->clear();
-
-               $this->provider = new IdealStatusProvider( array(
-                       'cache-parameters' => array(
-                               'duration' => 10,
-                               'key' => 'BLAH_BLAH'
-                       ),
-                       'availability-url' => 
'http://example.org/undocumented/api/GetIssuers'
-               ) );
-               $contents = file_get_contents( __DIR__ . 
"/../Data/availability.response" );
-               $parsed = CurlWrapper::parseResponse(
-                       $contents, array( 'http_code' => 200 )
-               );
-               $this->curlWrapper->method( 'execute' )->willReturn( $parsed );
-       }
-
-       public function testGetBankStatus() {
-               $results = $this->provider->getBankStatus();
-               $this->assertEquals(
-                       array(
-                               'ABNANL2A' => array(
-                                       'name' => 'ABN AMRO',
-                                       'availability' => '40',
-                               ),
-                               'INGBNL2A' => array(
-                                       'name' => 'Issuer Simulation V3 - ING',
-                                       'availability' => '100',
-                               )
-                       ),
-                       $results
-               );
-       }
-
-       public function testCacheBankStatus() {
-               $this->curlWrapper->expects( $this->once() )
-                       ->method( 'execute' );
-               $results = $this->provider->getBankStatus();
-               $this->assertEquals(
-                       array(
-                               'ABNANL2A' => array(
-                                       'name' => 'ABN AMRO',
-                                       'availability' => '40',
-                               ),
-                               'INGBNL2A' => array(
-                                       'name' => 'Issuer Simulation V3 - ING',
-                                       'availability' => '100',
-                               )
-                       ),
-                       $results
-               );
-               $cachedResults = $this->provider->getBankStatus();
-               $this->assertEquals( $results, $cachedResults );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/PayPal/Tests/PayPalTestConfiguration.php 
b/PaymentProviders/PayPal/Tests/PayPalTestConfiguration.php
deleted file mode 100644
index b87ccaa..0000000
--- a/PaymentProviders/PayPal/Tests/PayPalTestConfiguration.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\PayPal\Tests;
-
-use SmashPig\Core\GlobalConfiguration;
-use SmashPig\Tests\TestingProviderConfiguration;
-
-class PayPalTestConfiguration extends TestingProviderConfiguration {
-
-       public static function get( GlobalConfiguration $globalConfig ) {
-               return self::createForProviderWithOverrideFile(
-                       'paypal',
-                       __DIR__ . '/config_test.yaml',
-                       $globalConfig
-               );
-       }
-
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/PaymentProviders/PayPal/Tests/config_test.yaml 
b/PaymentProviders/PayPal/Tests/config_test.yaml
deleted file mode 100644
index e4b8c29..0000000
--- a/PaymentProviders/PayPal/Tests/config_test.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-api:
-    class: SmashPig\PaymentProviders\PayPal\Tests\MockPayPalPaymentsAPI
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
deleted file mode 100644
index 14cbee6..0000000
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ /dev/null
@@ -1,164 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\PaymentProviders\PayPal\Tests;
-
-use SmashPig\Core\Context;
-use SmashPig\Core\ProviderConfiguration;
-use SmashPig\CrmLink\Messages\SourceFields;
-use SmashPig\PaymentProviders\PayPal\Listener;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-use SmashPig\Core\Http\Response;
-use SmashPig\Core\Http\Request;
-use SmashPig\Core\DataStores\JsonSerializableObject;
-
-/**
- * Test the IPN listener which receives messages, stores and processes them.
- * @group PayPal
- */
-class CaptureIncomingMessageTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var ProviderConfiguration
-        */
-       public $config;
-
-       static $fail_verification = false;
-       static $paypal_is_broken = false;
-
-       // filename and the queue it should get dropped in
-       static $message_data = array(
-               'web_accept.json' => 'donations',
-               'express_checkout.json' => 'donations',
-               'recurring_payment_profile_created.json' => 'recurring',
-               'subscr_signup.json' => 'recurring',
-               'subscr_payment.json' => 'recurring',
-               'recurring_payment.json' => 'recurring',
-               'refund.json' => 'refund',
-               'refund_ec.json' => 'refund',
-               'refund_recurring_ec.json' => 'refund',
-               'chargeback_settlement.json' => 'refund',
-               // this should not actually get written to
-               // TODO 'new_case.json' => 'no-op',
-       );
-
-       public function setUp() {
-               parent::setUp();
-               $this->config = Context::get()->getGlobalConfiguration();
-               Context::get()->setProviderConfiguration(
-                       PayPalTestConfiguration::get( $this->config )
-               );
-       }
-
-       public function tearDown() {
-               self::$fail_verification = false;
-               self::$paypal_is_broken = false;
-               parent::tearDown();
-       }
-
-       public function messageProvider() {
-               $messages = array();
-               foreach ( self::$message_data as $file => $type ) {
-                       $payloadFile = __DIR__ . '/../Data/' . $file;
-                       $messageData = array(
-                               'type' => $type,
-                               'payload' => json_decode(
-                                       file_get_contents( $payloadFile ),
-                                       true
-                               )
-                       );
-                       $transformedFile = str_replace( '.json', 
'_transformed.json', $payloadFile );
-                       if ( file_exists( $transformedFile ) ) {
-                               $messageData['transformed'] = json_decode(
-                                       file_get_contents( $transformedFile ),
-                                       true
-                               );
-                       }
-                       $messages[] = array( $messageData );
-               }
-               return $messages;
-       }
-
-       private function capture( $msg ) {
-               $request = new Request( $msg );
-               $response = new Response;
-               $listener = new Listener;
-               return $listener->execute( $request, $response );
-       }
-
-       /**
-        * @dataProvider messageProvider
-        */
-       public function testCapture( $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() );
-       }
-
-       /**
-        * @dataProvider messageProvider
-        */
-       public function testConsume( $msg ) {
-               $this->capture( $msg['payload'] );
-
-               $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
-               $jobMessage = $jobQueue->pop();
-
-               $job = JsonSerializableObject::fromJsonProxy(
-                       $jobMessage['php-message-class'],
-                       json_encode( $jobMessage )
-               );
-
-               $job->execute();
-
-               $queue = $this->config->object( 'data-store/' . $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'] );
-                       }
-
-                       if ( isset( $message['supplemental_address_1'] ) ) {
-                               $this->assertNotEquals(
-                                       $message['supplemental_address_1'],
-                                       "{$message['first_name']} 
{$message['last_name']}"
-                               );
-                       }
-                       if ( isset( $msg['transformed'] ) ) {
-                               SourceFields::removeFromMessage( $message );
-                               $this->assertEquals( $msg['transformed'], 
$message );
-                       }
-               }
-       }
-
-       public function testFailedVerification() {
-               self::$fail_verification = true;
-               $jobMessage = array( 'txn_type' => 'fail' );
-               $this->assertFalse( $this->capture( $jobMessage ) );
-       }
-
-       // FIXME: not really testing anything. Would like to verify that it 
tried
-       // N times. Bubble that information up somehow.
-       public function testPayPalIsBroken() {
-               self::$paypal_is_broken = true;
-               $jobMessage = array( 'txn_type' => 'fail' );
-               $this->assertFalse( $this->capture( $jobMessage ) );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/BaseSmashPigUnitTestCase.php 
b/Tests/BaseSmashPigUnitTestCase.php
deleted file mode 100644
index ef1bb98..0000000
--- a/Tests/BaseSmashPigUnitTestCase.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\Tests;
-
-use SmashPig\Core\Context;
-
-use PHPUnit_Framework_TestCase;
-
-class BaseSmashPigUnitTestCase extends PHPUnit_Framework_TestCase {
-
-       public function setUp() {
-               parent::setUp();
-               $globalConfig = TestingGlobalConfiguration::create();
-               TestingContext::init( $globalConfig );
-               // TODO: create tables for all dbs/queues.
-               // Standard issue CurlWrapper mock would be nice too
-       }
-
-       public function tearDown() {
-               Context::set(); // Nullify the context for next run.
-       }
-
-       protected function loadJson( $path ) {
-               return json_decode( file_get_contents( $path ), true );
-       }
-
-       /**
-        * @param $provider
-        * @return TestingProviderConfiguration
-        */
-       protected function setProviderConfiguration( $provider ) {
-               $ctx = Context::get();
-               $globalConfig = $ctx->getGlobalConfiguration();
-               $config = TestingProviderConfiguration::createForProvider( 
$provider, $globalConfig );
-               $ctx->setProviderConfiguration( $config );
-               return $config;
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/ConfigurationTest.php b/Tests/ConfigurationTest.php
deleted file mode 100644
index 0300ed9..0000000
--- a/Tests/ConfigurationTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-namespace SmashPig\Tests;
-
-use SmashPig\Core\Context;
-use SmashPig\Core\Logging\LogStreams\ConsoleLogStream;
-
-/**
- */
-class ConfigurationTest extends BaseSmashPigUnitTestCase {
-
-       public function testOverride() {
-               $config = Context::get()->getProviderConfiguration();
-
-               $this->assertEquals( 'SmashPig', $config->val( 
'logging/root-context' ),
-                       'Default config was as expected.' );
-               $config->override( array(
-                       'logging' => array(
-                               'root-context' => 'FOO',
-                       ),
-               ) );
-               $this->assertEquals( 'FOO', $config->val( 
'logging/root-context' ),
-                       'Config was overridden.' );
-       }
-
-       /**
-        * Check that sparsely populated deep structures override one another
-        * additively, and we don't lose branches from half of the union.
-        * TODO: Provide more cases using a dataProvider.
-        */
-       public function testOverrideDeep() {
-               $config = Context::get()->getProviderConfiguration();
-
-               $config->override( array(
-                       'endpoints' => array(
-                               'listener' => array(
-                                       'class' => 'SmashPig\Ham',
-                                       'postback-url' => 'http://Salad',
-                               ),
-                       ),
-               ) );
-
-               $config->override( array(
-                       'endpoints' => array(
-                               'listener' => array(
-                                       'postback-url' => 'http://Rice',
-                               ),
-                       ),
-               ) );
-
-               $expected = array(
-                       'class' => 'SmashPig\Ham',
-                       'postback-url' => 'http://Rice',
-               );
-
-               $this->assertEquals( $expected, $config->val( 
'endpoints/listener' ),
-                       'Deep merge went as hoped' );
-       }
-
-       public function testOverrideObjectInstance() {
-               $config = Context::get()->getProviderConfiguration();
-
-               $this->assertInstanceOf(
-                       'SmashPig\Core\Logging\LogStreams\SyslogLogStream',
-                       $config->object( 'logging/log-streams/syslog' ),
-                       'Default config was not as expected.'
-               );
-
-               $overrideInstance = new ConsoleLogStream();
-               $config->overrideObjectInstance(
-                       'logging/log-streams/syslog',
-                       $overrideInstance
-               );
-               $this->assertEquals(
-                       spl_object_hash( $overrideInstance ),
-                       spl_object_hash( $config->object( 
'logging/log-streams/syslog' ) ),
-                       'Sorcery fizzled out. Do you have enough mana?'
-               );
-       }
-
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/DamagedDatabaseTest.php b/Tests/DamagedDatabaseTest.php
deleted file mode 100644
index 543ce16..0000000
--- a/Tests/DamagedDatabaseTest.php
+++ /dev/null
@@ -1,138 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\Tests;
-
-use PDO;
-
-use SmashPig\Core\DataStores\DamagedDatabase;
-
-class DamagedDatabaseTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var DamagedDatabase
-        */
-       protected $db;
-
-       public function setUp() {
-               parent::setUp();
-               $this->db = DamagedDatabase::get();
-       }
-
-       public function tearDown() {
-               TestingDatabase::clearStatics( $this->db );
-               parent::tearDown();
-       }
-
-       protected static function getTestMessage( $uniq = null ) {
-               if ( !$uniq ) {
-                       $uniq = mt_rand();
-               }
-               return array(
-                       'gateway' => 'test',
-                       'gateway_txn_id' => "txn-{$uniq}",
-                       'order_id' => "order-{$uniq}",
-                       'gateway_account' => 'default',
-                       'date' => 1468973648,
-                       'amount' => 123,
-                       'currency' => 'EUR',
-               );
-       }
-
-       public function testStoreMessage() {
-               $message = self::getTestMessage();
-               $queue = 'test_queue';
-               $err = 'ERROR MESSAGE';
-               $trace = "Foo.php line 25\nBar.php line 99";
-
-               $damagedId = $this->db->storeMessage( $message, $queue, $err, 
$trace );
-
-               // Confirm work without using the API.
-               $pdo = $this->db->getDatabase();
-               $result = $pdo->query( "
-                       SELECT * FROM damaged
-                       WHERE gateway='test'
-                       AND order_id = '{$message['order_id']}'" );
-               $rows = $result->fetchAll( PDO::FETCH_ASSOC );
-               $this->assertEquals( 1, count( $rows ),
-                       'One row stored and retrieved.' );
-               $expected = array(
-                       'id' => $damagedId,
-                       // NOTE: This is a db-specific string, sqlite3 in this 
case, and
-                       // you'll have different formatting if using any other 
database.
-                       'original_date' => '20160720001408',
-                       'gateway' => 'test',
-                       'order_id' => $message['order_id'],
-                       'gateway_txn_id' => $message['gateway_txn_id'],
-                       'message' => json_encode( $message ),
-                       'original_queue' => $queue,
-                       'error' => $err,
-                       'trace' => $trace,
-                       'retry_date' => null,
-               );
-               unset( $rows[0]['damaged_date'] );
-               $this->assertEquals( $expected, $rows[0],
-                       'Stored message had expected contents' );
-       }
-
-       public function testFetchRetryMessages() {
-               $message = self::getTestMessage();
-               $this->db->storeMessage( $message, 'test_queue', '', '', time() 
- 1 );
-
-               $fetched = $this->db->fetchRetryMessages( 10 );
-
-               $this->assertNotNull( $fetched,
-                       'No record retrieved by fetchRetryMessages.' );
-
-               $expected = $message + array(
-                       'damaged_id' => 1,
-                       'original_queue' => 'test_queue'
-               );
-               $this->assertEquals( $expected, $fetched[0],
-                       'Fetched record does not matches stored message.' );
-       }
-
-       public function testDeleteMessage() {
-               $uniq = mt_rand();
-               $queue = 'test_queue';
-               $message1 = $this->getTestMessage( $uniq );
-               // Store a second message for a good time, and make sure we 
delete the
-               // right one.
-               $message2 = $this->getTestMessage( $uniq );
-
-               $this->db->storeMessage( $message1, $queue );
-               // store message 2 with a
-               $this->db->storeMessage( $message2, $queue );
-
-               // Confirm work without using the API.
-               $pdo = $this->db->getDatabase();
-               $result = $pdo->query( "
-                       SELECT * FROM damaged
-                       WHERE gateway='test'
-                               AND order_id = '{$message1['order_id']}'" );
-               $rows = $result->fetchAll( PDO::FETCH_ASSOC );
-               $this->assertEquals( 2, count( $rows ),
-                       'Both records were stored.' );
-               $this->assertNotNull( $rows[0]['id'],
-                       'Record includes a primary row id' );
-               $this->assertNotEquals( $rows[0]['id'], $rows[1]['id'],
-                       'Records have unique primary ids' );
-
-               $message2['damaged_id'] = $rows[1]['id'];
-               $this->db->deleteMessage( $message2 );
-
-               // Confirm work without using the API.
-               $pdo = $this->db->getDatabase();
-               $result = $pdo->query( "
-                       SELECT * FROM damaged
-                       WHERE gateway='test'
-                               AND order_id = '{$message1['order_id']}'" );
-               $rowsAfter = $result->fetchAll( PDO::FETCH_ASSOC );
-               $this->assertEquals( 1, count( $rowsAfter ),
-                       'Not only one row deleted.' );
-               $this->assertEquals( $rowsAfter[0]['id'], $rows[0]['id'],
-                       'Deleted the wrong row.' );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/FileDumperTest.php b/Tests/FileDumperTest.php
deleted file mode 100644
index 0b92ca6..0000000
--- a/Tests/FileDumperTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\Tests;
-
-
-use SmashPig\Core\DataStores\QueueWrapper;
-use SmashPig\Core\QueueConsumers\QueueFileDumper;
-
-class FileDumperTest extends BaseSmashPigUnitTestCase {
-
-       protected $filename;
-
-       public function setUp() {
-               parent::setUp();
-               $this->filename = tempnam( '/tmp', 'sptest' );
-       }
-
-       public function tearDown() {
-               parent::tearDown();
-               if ( file_exists( $this->filename ) ) {
-                       unlink( $this->filename );
-               }
-       }
-
-       public function testDump() {
-               $queue = QueueWrapper::getQueue( 'test' );
-               $expected = '';
-               for( $i = 0; $i < 5; $i++ ) {
-                       $message = array(
-                               'psycho' => 'alpha',
-                               'disco' => 'beta',
-                               'bio' => 'aqua',
-                               'dooloop' => mt_rand()
-                       );
-                       $queue->push( $message );
-                       $expected .= json_encode( $message ) . "\n";
-               }
-               $dumper = new QueueFileDumper( 'test', 0, $this->filename );
-               $dumper->dequeueMessages();
-               $this->assertEquals( $expected, file_get_contents( 
$this->filename ) );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/PaymentsInitialDatabaseTest.php 
b/Tests/PaymentsInitialDatabaseTest.php
deleted file mode 100644
index ae1c84d..0000000
--- a/Tests/PaymentsInitialDatabaseTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\Tests;
-
-
-use SmashPig\Core\DataStores\PaymentsInitialDatabase;
-use SmashPig\Core\UtcDate;
-
-class PaymentsInitialDatabaseTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var PaymentsInitialDatabase
-        */
-       protected $db;
-
-       public function setUp() {
-               parent::setUp();
-               $this->db = PaymentsInitialDatabase::get();
-       }
-
-       public function tearDown() {
-               TestingDatabase::clearStatics( $this->db );
-
-               parent::tearDown();
-       }
-
-       public static function generateTestMessage() {
-               $message = array(
-                       'id' => mt_rand(),
-                       'contribution_tracking_id' => mt_rand(),
-                       'gateway' => 'test_gateway',
-                       'order_id' => mt_rand(),
-                       'gateway_txn_id' => mt_rand(),
-                       'validation_action' => 'process',
-                       'payments_final_status' => 'complete',
-                       'payment_method' => 'cc',
-                       'payment_submethod' => 'jcb',
-                       'country' => 'FR',
-                       'amount' => 1.01,
-                       'currency_code' => 'EUR',
-                       'server' => 'localhost',
-                       'date' => UtcDate::getUtcDatabaseString( time() ),
-               );
-               return $message;
-       }
-
-       public function testFetchMessageByGatewayOrderId() {
-               $message = self::generateTestMessage();
-               $this->db->storeMessage( $message );
-
-               $fetched = $this->db->fetchMessageByGatewayOrderId(
-                       'test_gateway', $message['order_id'] );
-               $this->assertNotNull( $fetched,
-                       'Record retrieved by fetchMessageByGatewayOrderId.' );
-
-               $this->assertEquals( $message, $fetched,
-                       'Fetched record matches stored message.' );
-       }
-
-       /**
-        * Test that fetchMessageByGatewayOrderId returns null when the message
-        * isn't found.
-        */
-       public function testFetchMessageByGatewayOrderIdNone() {
-               $message = $this->generateTestMessage();
-               $this->db->storeMessage( $message );
-
-               $fetched = $this->db->fetchMessageByGatewayOrderId(
-                       'test_gateway', $message['order_id'] + 1 );
-               $this->assertNull( $fetched,
-                       'Record correctly not found 
fetchMessageByGatewayOrderId.' );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/PendingDatabaseTest.php b/Tests/PendingDatabaseTest.php
deleted file mode 100644
index 7952655..0000000
--- a/Tests/PendingDatabaseTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\Tests;
-
-use PDO;
-
-use SmashPig\Core\DataStores\PendingDatabase;
-
-class PendingDatabaseTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var PendingDatabase
-        */
-       protected $db;
-
-       public function setUp() {
-               parent::setUp();
-               $this->db = PendingDatabase::get();
-       }
-
-       public function tearDown() {
-               TestingDatabase::clearStatics( $this->db );
-
-               parent::tearDown();
-       }
-
-       protected static function getTestMessage( $uniq = null ) {
-               if ( !$uniq ) { 
-                       $uniq = mt_rand();
-               }
-               return array(
-                       'gateway' => 'test',
-                       'gateway_txn_id' => "txn-{$uniq}",
-                       'order_id' => "order-{$uniq}",
-                       'gateway_account' => 'default',
-                       'date' => 1468973648,
-                       'amount' => 123,
-                       'currency' => 'EUR',
-               );
-       }
-
-       public function testStoreMessage() {
-               $message = self::getTestMessage();
-               $this->db->storeMessage( $message );
-
-               // Confirm work without using the API.
-               $pdo = $this->db->getDatabase();
-               $result = $pdo->query( "
-                       select * from pending
-                       where gateway='test'
-                               and order_id = '{$message['order_id']}'" );
-               $rows = $result->fetchAll( PDO::FETCH_ASSOC );
-               $this->assertEquals( 1, count( $rows ),
-                       'One row stored and retrieved.' );
-               $expected = array(
-                       'id' => '1',
-                       // NOTE: This is a db-specific string, sqlite3 in this 
case, and
-                       // you'll have different formatting if using any other 
database.
-                       'date' => '20160720001408',
-                       'gateway' => 'test',
-                       'gateway_account' => 'default',
-                       'order_id' => $message['order_id'],
-                       'gateway_txn_id' => $message['gateway_txn_id'],
-                       'message' => json_encode( $message ),
-               );
-               $this->assertEquals( $expected, $rows[0],
-                       'Stored message had expected contents' );
-       }
-
-       public function testFetchMessageByGatewayOrderId() {
-               $message = self::getTestMessage();
-               $this->db->storeMessage( $message );
-
-               $fetched = $this->db->fetchMessageByGatewayOrderId( 'test', 
$message['order_id'] );
-               $this->assertNotNull( $fetched,
-                       'Record retrieved by fetchMessageByGatewayOrderId.' );
-
-               $expected = $message + array(
-                       'pending_id' => 1,
-               );
-               $this->assertEquals( $expected, $fetched,
-                       'Fetched record matches stored message.' );
-       }
-
-       public function testFetchMessageByGatewayOldest() {
-               $message1 = $this->getTestMessage();
-               $message2 = $this->getTestMessage();
-
-               // Make the second message older.
-               $message2['date'] = $message1['date'] - 100;
-
-               $this->db->storeMessage( $message1 );
-               $this->db->storeMessage( $message2 );
-
-               $fetched = $this->db->fetchMessageByGatewayOldest( 'test' );
-               $this->assertNotNull( $fetched,
-                       'Retrieved a record using fetchMessageByGatewayOldest' 
);
-               $this->assertEquals( $message2['date'], $fetched['date'],
-                       'Got the oldest record.' );
-       }
-
-       public function testDeleteMessage() {
-               $uniq = mt_rand();
-               $message1 = $this->getTestMessage( $uniq );
-               // Store a second message for a good time, and make sure we 
delete the
-               // right one.
-               $message2 = $this->getTestMessage( $uniq );
-
-               $this->db->storeMessage( $message1 );
-               $this->db->storeMessage( $message2 );
-
-               // Confirm work without using the API.
-               $pdo = $this->db->getDatabase();
-               $result = $pdo->query( "
-                       select * from pending
-                       where gateway='test'
-                               and order_id = '{$message1['order_id']}'" );
-               $rows = $result->fetchAll( PDO::FETCH_ASSOC );
-               $this->assertEquals( 2, count( $rows ),
-                       'Both records were stored.' );
-               $this->assertNotNull( $rows[0]['id'],
-                       'Record includes a primary row id' );
-               $this->assertNotEquals( $rows[0]['id'], $rows[1]['id'],
-                       'Records have unique primary ids' );
-
-               $this->db->deleteMessage( $message1 );
-
-               // Confirm work without using the API.
-               $pdo = $this->db->getDatabase();
-               $result = $pdo->query( "
-                       select * from pending
-                       where gateway = 'test'
-                               and order_id = '{$message1['order_id']}'" );
-               $rows = $result->fetchAll( PDO::FETCH_ASSOC );
-               $this->assertEquals( 0, count( $rows ),
-                       'All rows deleted.' );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/PendingQueueConsumerTest.php 
b/Tests/PendingQueueConsumerTest.php
deleted file mode 100644
index 495001e..0000000
--- a/Tests/PendingQueueConsumerTest.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\Tests;
-
-
-use SmashPig\Core\DataStores\PaymentsInitialDatabase;
-use SmashPig\Core\DataStores\PendingDatabase;
-use SmashPig\Core\QueueConsumers\PendingQueueConsumer;
-
-class PendingQueueConsumerTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var PendingDatabase
-        */
-       protected $pendingDb;
-
-       /**
-        * @var PaymentsInitialDatabase
-        */
-       protected $paymentsInitialDb;
-
-       public function setUp() {
-               parent::setUp();
-               $this->pendingDb = PendingDatabase::get();
-               $this->paymentsInitialDb = PaymentsInitialDatabase::get();
-       }
-
-       public function tearDown() {
-               // FIXME: huh.  I guess we should use class names to avoid 
possible
-               // incomplete destruction in the case that paymentsInitialDb 
was never
-               // initialized.
-               TestingDatabase::clearStatics( $this->paymentsInitialDb );
-               TestingDatabase::clearStatics( $this->pendingDb );
-
-               parent::tearDown();
-       }
-
-       /**
-        * We consume a message normally if there's nothing in the 
payments_initial
-        * table.
-        */
-       public function testPendingMessageNotInInitial() {
-               $consumer = new PendingQueueConsumer( 'pending', 1000, 1000 );
-               $message = self::generateRandomPendingMessage();
-
-               $consumer->processMessage( $message );
-
-               $fetched = $this->pendingDb->fetchMessageByGatewayOrderId(
-                       $message['gateway'], $message['order_id'] );
-
-               $this->assertNotNull( $fetched,
-                       'Message was consumed and stored in the pending 
database.' );
-
-               unset( $fetched['pending_id'] );
-               $this->assertEquals( $message, $fetched,
-                       'Stored message is equal to the consumed message.' );
-       }
-
-       /**
-        * We consume a message normally if the corresponding payments_initial 
row
-        * is still pending.
-        */
-       public function testPendingMessageInitialPending() {
-               $initRow = PaymentsInitialDatabaseTest::generateTestMessage();
-               $initRow['payments_final_status'] = 'pending';
-
-               $this->paymentsInitialDb->storeMessage( $initRow );
-
-               $message = self::generatePendingMessageFromInitial( $initRow );
-               $consumer = new PendingQueueConsumer( 'pending', 1000, 1000 );
-
-               $consumer->processMessage( $message );
-
-               $fetched = $this->pendingDb->fetchMessageByGatewayOrderId(
-                       $message['gateway'], $message['order_id'] );
-
-               $this->assertNotNull( $fetched,
-                       'Message was consumed and stored in the pending 
database.' );
-
-               unset( $fetched['pending_id'] );
-               $this->assertEquals( $message, $fetched,
-                       'Stored message is equal to the consumed message.' );
-       }
-
-       /**
-        * We refuse to consume a message and drop it if the corresponding
-        * payments_initial row is failed.
-        */
-       public function testPendingMessageInitialFailed() {
-               $initRow = PaymentsInitialDatabaseTest::generateTestMessage();
-               $initRow['payments_final_status'] = 'failed';
-               $initRow['validation_action'] = 'reject';
-
-               $this->paymentsInitialDb->storeMessage( $initRow );
-
-               $message = self::generatePendingMessageFromInitial( $initRow );
-               $consumer = new PendingQueueConsumer( 'pending', 1000, 1000 );
-
-               $consumer->processMessage( $message );
-
-               $fetched = $this->pendingDb->fetchMessageByGatewayOrderId(
-                       $message['gateway'], $message['order_id'] );
-
-               $this->assertNull( $fetched,
-                       'Message consumed and not stored in the pending 
database.' );
-       }
-
-       public static function generateRandomPendingMessage() {
-               $message = array(
-                       'gateway' => 'test',
-                       'date' => time(),
-                       'order_id' => mt_rand(),
-                       'cousin' => 'itt',
-                       'kookiness' => mt_rand(),
-               );
-               return $message;
-       }
-
-       /**
-        * Create an incoming pending message corresponding to a given
-        * payments_initial row.
-        *
-        * @param array $initialRow
-        * @return array Message suitable for the pending queue.
-        */
-       public static function generatePendingMessageFromInitial( $initialRow ) 
{
-               $message = array(
-                       'gateway' => $initialRow['gateway'],
-                       'date' => $initialRow['date'],
-                       'order_id' => $initialRow['order_id'],
-                       'cousin' => 'itt',
-                       'kookiness' => mt_rand(),
-               );
-               return $message;
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/QueueConsumerTest.php b/Tests/QueueConsumerTest.php
deleted file mode 100644
index dfe0611..0000000
--- a/Tests/QueueConsumerTest.php
+++ /dev/null
@@ -1,194 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\Tests;
-
-use Exception;
-use PDO;
-use PHPQueue\Interfaces\FifoQueueStore;
-
-use SmashPig\Core\DataStores\DamagedDatabase;
-use SmashPig\Core\DataStores\QueueWrapper;
-
-class QueueConsumerTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var FifoQueueStore
-        */
-       protected $queue;
-       /**
-        * @var PDO
-        */
-       protected $damaged;
-
-       public function setUp() {
-               parent::setUp();
-               $this->queue = QueueWrapper::getQueue( 'test' );
-               $damagedDb = DamagedDatabase::get();
-               $this->damaged = $damagedDb->getDatabase();
-       }
-
-       public function testEmptyQueue() {
-               $consumer = new TestingQueueConsumer( 'test' );
-               $count = $consumer->dequeueMessages();
-               $this->assertEquals( 0, $count, 'Should report 0 messages 
processed' );
-       }
-
-       public function testOneMessage() {
-               $consumer = new TestingQueueConsumer( 'test' );
-               $payload = array(
-                       'wednesday' => 'addams',
-                       'spookiness' => mt_rand(),
-               );
-               $this->queue->push( $payload );
-               $count = $consumer->dequeueMessages();
-               $this->assertEquals( 1, $count, 'Should report 1 message 
processed' );
-               $this->assertEquals( array( $payload ), $consumer->processed, 
'Bad message' );
-               $this->assertNull( $this->queue->pop(),
-                       'Should delete message when processing is successful'
-               );
-       }
-
-       public function testDamagedQueue() {
-               $payload = array(
-                       'gateway' => 'test',
-                       'date' => time(),
-                       'order_id' => mt_rand(),
-                       'cousin' => 'itt',
-                       'kookiness' => mt_rand(),
-               );
-
-               $consumer = new TestingQueueConsumer( 'test' );
-               $consumer->exception = new Exception( 'kaboom!' );
-
-               $this->queue->push( $payload );
-               try {
-                       $consumer->dequeueMessages();
-               } catch ( Exception $ex ) {
-                       $this->fail(
-                               'Exception should not have bubbled up: ' . 
$ex->getMessage()
-                       );
-               }
-               $this->assertEquals(
-                       array( $payload ),
-                       $consumer->processed,
-                       'Processing snafu'
-               );
-
-               $damaged = $this->getDamagedQueueMessage( $payload );
-               $this->assertEquals(
-                       $payload,
-                       $damaged,
-                       'Should move message to damaged queue when exception is 
thrown'
-               );
-               $this->assertNull(
-                       $this->queue->pop(),
-                       'Should delete message on exception when damaged queue 
exists'
-               );
-       }
-
-       public function testMessageLimit() {
-               $messages = array();
-               for ( $i = 0; $i < 5; $i++ ) {
-                       $message = array(
-                               'gateway' => 'test',
-                               'date' => time(),
-                               'order_id' => mt_rand(),
-                               'box' => 'thing' . $i,
-                               'creepiness' => mt_rand(),
-                       );
-                       $messages[] = $message;
-                       $this->queue->push( $message );
-               }
-               // Should work when you pass in the limits as strings.
-               $consumer = new TestingQueueConsumer( 'test', 0, '3' );
-               $count = $consumer->dequeueMessages();
-               $this->assertEquals(
-                       3, $count, 'dequeueMessages returned wrong count'
-               );
-               $this->assertEquals(
-                       3,
-                       count( $consumer->processed ),
-                       'Called callback wrong number of times'
-               );
-
-               for ( $i = 0; $i < 3; $i++ ) {
-                       $this->assertEquals(
-                               $messages[$i],
-                               $consumer->processed[$i],
-                               'Message mutated'
-                       );
-               }
-               $this->assertEquals(
-                       $messages[3],
-                       $this->queue->pop(),
-                       'Dequeued too many messages'
-               );
-       }
-
-       public function testKeepRunningOnDamage() {
-               $messages = array();
-               for ( $i = 0; $i < 5; $i++ ) {
-                       $message = array(
-                               'gateway' => 'test',
-                               'date' => time(),
-                               'order_id' => mt_rand(),
-                               'box' => 'thing' . $i,
-                               'creepiness' => mt_rand(),
-                       );
-                       $messages[] = $message;
-                       $this->queue->push( $message );
-               }
-
-               $consumer = new TestingQueueConsumer( 'test', 0, 3 );
-               $consumer->exception = new Exception( 'Kaboom!' );
-               $count = 0;
-               try {
-                       $count = $consumer->dequeueMessages();
-               } catch ( Exception $ex ) {
-                       $this->fail(
-                               'Exception should not have bubbled up: ' . 
$ex->getMessage()
-                       );
-               }
-               $this->assertEquals(
-                       3, $count, 'dequeueMessages returned wrong count'
-               );
-               $this->assertEquals(
-                       3,
-                       count( $consumer->processed ),
-                       'Called callback wrong number of times'
-               );
-
-               for ( $i = 0; $i < 3; $i++ ) {
-                       $this->assertEquals(
-                               $messages[$i], $consumer->processed[$i], 
'Message mutated'
-                       );
-                       $damaged = $this->getDamagedQueueMessage( $messages[$i] 
);
-                       $this->assertEquals(
-                               $messages[$i],
-                               $damaged,
-                               'Should move message to damaged queue when 
exception is thrown'
-                       );
-               }
-               $this->assertEquals(
-                       $messages[3],
-                       $this->queue->pop(),
-                       'message 4 should be at the head of the queue'
-               );
-       }
-
-       protected function getDamagedQueueMessage( $message ) {
-               $select = $this->damaged->query( "
-                       SELECT * FROM damaged
-                       WHERE gateway='{$message['gateway']}'
-                       AND order_id = '{$message['order_id']}'" );
-               $msg = $select->fetch( PDO::FETCH_ASSOC );
-               if ( $msg ) {
-                       return json_decode( $msg['message'], true );
-               }
-               return null;
-       }
-
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/SmashPigDatabaseTest.php b/Tests/SmashPigDatabaseTest.php
deleted file mode 100644
index 6f154b8..0000000
--- a/Tests/SmashPigDatabaseTest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\Tests;
-
-
-use SmashPig\Core\DataStores\PaymentsInitialDatabase;
-use SmashPig\Core\DataStores\PendingDatabase;
-
-class SmashPigDatabaseTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var PendingDatabase
-        */
-       protected $pendingDb;
-
-       /**
-        * @var PaymentsInitialDatabase
-        */
-       protected $paymentsInitialDb;
-
-       public function setUp() {
-               parent::setUp();
-
-               $this->pendingDb = PendingDatabase::get();
-               $this->paymentsInitialDb = PaymentsInitialDatabase::get();
-       }
-
-       public function tearDown() {
-               TestingDatabase::clearStatics( $this->paymentsInitialDb );
-               TestingDatabase::clearStatics( $this->pendingDb );
-
-               parent::tearDown();
-       }
-
-       public function testDifferentDatabases() {
-               $pendingPdo = $this->pendingDb->getDatabase();
-               $initPdo = $this->paymentsInitialDb->getDatabase();
-               $this->assertNotEquals(
-                       spl_object_hash( $pendingPdo ),
-                       spl_object_hash( $initPdo ),
-                       'Pending and paymentsInit databases share the same PDO'
-               );
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/TestingContext.php b/Tests/TestingContext.php
deleted file mode 100644
index db93ef4..0000000
--- a/Tests/TestingContext.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-
-namespace SmashPig\Tests;
-
-use SmashPig\Core\Context;
-use SmashPig\Core\DataStores\QueueWrapper;
-use SmashPig\Core\GlobalConfiguration;
-
-class TestingContext extends Context {
-       public $providerConfigurationOverride;
-
-       public static function init(
-               GlobalConfiguration $config, $providerConfig = null
-       ) {
-               // Override the existing context
-               Context::$instance = new TestingContext();
-               if ( !$providerConfig ) {
-                       $providerConfig = 
TestingProviderConfiguration::createDefault( $config );
-               }
-               Context::$instance->setProviderConfiguration( $providerConfig );
-               Context::$instance->setGlobalConfiguration( $config );
-               TestingDatabase::createTables();
-               self::initializeQueues( $config );
-       }
-
-       protected static function initializeQueues( GlobalConfiguration $config 
) {
-               foreach ( $config->val( 'data-store' ) as $name => $definition 
) {
-                       if (
-                               array_key_exists( 'class', $definition ) &&
-                               // FIXME should really only do this for 
\PHPQueue\Backend\PDO
-                               is_subclass_of( $definition['class'], 
'\PHPQueue\Interfaces\FifoQueueStore' )
-                       ) {
-                               // FIXME PDO backend should know which table to 
create without an arg
-                               if ( array_key_exists( 'queue', 
$definition['constructor-parameters'][0] ) ) {
-                                       $table = 
$definition['constructor-parameters'][0]['queue'];
-                               } else {
-                                       $table = $name;
-                               }
-                               QueueWrapper::getQueue( $name )->createTable( 
$table );
-                       }
-               }
-       }
-
-       public function getProviderConfiguration() {
-               if ( $this->providerConfigurationOverride ) {
-                       return $this->providerConfigurationOverride;
-               }
-               return parent::getProviderConfiguration();
-       }
-
-}
diff --git a/Tests/TestingDatabase.php b/Tests/TestingDatabase.php
deleted file mode 100644
index 23475a9..0000000
--- a/Tests/TestingDatabase.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-namespace SmashPig\Tests;
-
-use SmashPig\Core\DataStores\DamagedDatabase;
-use SmashPig\Core\DataStores\PaymentsInitialDatabase;
-use SmashPig\Core\DataStores\PendingDatabase;
-
-class TestingDatabase {
-       /**
-        * @param string|object $classish Database class to reset, as a 
qualified
-        * class name or example object.  Must be a subtype of SmashPigDatabase 
for
-        * the statics to make sense.
-        */
-       public static function clearStatics( $classish ) {
-               $klass = new \ReflectionClass( $classish );
-               $dbProperty = $klass->getProperty( 'dbs' );
-               $dbProperty->setAccessible( true );
-               $dbProperty->setValue( array() );
-       }
-
-       /**
-        * Initialize all the db tables
-        */
-       public static function createTables() {
-               DamagedDatabase::get()->createTable();
-               PaymentsInitialDatabase::get()->createTable();
-               PendingDatabase::get()->createTable();
-       }
-}
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/TestingGlobalConfiguration.php 
b/Tests/TestingGlobalConfiguration.php
deleted file mode 100644
index 7ffe0a2..0000000
--- a/Tests/TestingGlobalConfiguration.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-namespace SmashPig\Tests;
-
-use SmashPig\Core\GlobalConfiguration;
-
-/**
- * Configuration that mocks all dbs and queues, and ignores override
- * files in /etc/smashpig/ and ~/.smashpig/
- */
-class TestingGlobalConfiguration extends GlobalConfiguration {
-       /**
-        * Set default search path to skip actual installed configuration like 
/etc
-        *
-        * @implements Configuration::getDefaultSearchPath
-        */
-       protected function getDefaultSearchPath() {
-               $searchPath = array();
-               $searchPath[] = __DIR__ . '/data/test_global.yaml';
-               $searchPath[] = __DIR__ . '/../config/main.yaml';
-               return $searchPath;
-       }
-
-       public static function loadConfigWithLiteralOverrides( $data ) {
-               $config = static::create();
-               $config->override( $data );
-               return $config;
-       }
-}
diff --git a/Tests/TestingProviderConfiguration.php 
b/Tests/TestingProviderConfiguration.php
deleted file mode 100644
index d3ec75f..0000000
--- a/Tests/TestingProviderConfiguration.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace SmashPig\Tests;
-
-use SmashPig\Core\ProviderConfiguration;
-
-/**
- * ProviderConfiguration that ignores /etc/smashpig and ~/.smashpig
- */
-class TestingProviderConfiguration extends ProviderConfiguration {
-       /**
-        * Set default search path to skip actual installed configuration like 
/etc
-        *
-        * @implements Configuration::getDefaultSearchPath
-        */
-       protected function getDefaultSearchPath() {
-               $searchPaths = array();
-               if ( $this->provider !== self::NO_PROVIDER ) {
-                       $searchPaths[] = __DIR__ . 
"/../config/{$this->provider}/main.yaml";
-               }
-               $searchPaths[] = __DIR__ . '/../config/provider-defaults.yaml';
-               return $searchPaths;
-       }
-}
diff --git a/Tests/bootstrap-phpunit.php b/Tests/bootstrap-phpunit.php
deleted file mode 100644
index 4d9d6b9..0000000
--- a/Tests/bootstrap-phpunit.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<<<<<<< HEAD   (d4458f Merge branch 'master' into deployment)
-=======
-<?php
-
-require_once ( __DIR__ . '/../vendor/autoload.php' );
->>>>>>> BRANCH (756898 Get provider config dir from global config)
diff --git a/Tests/data/test_global.yaml b/Tests/data/test_global.yaml
deleted file mode 100644
index fe2fa31..0000000
--- a/Tests/data/test_global.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-data-store:
-    mock-queue: &QUEUE
-        class: PHPQueue\Backend\PDO
-        constructor-parameters:
-            -
-                connection_string: 'sqlite::memory:'
-
-    mock-db: &DB
-        class: PDO
-        constructor-parameters:
-            - 'sqlite::memory:'
-
-    test:
-        <<: *QUEUE
-
-    payments-antifraud:
-        # Testing backend needs queue to be a valid table name
-        class: PHPQueue\Backend\PDO
-        constructor-parameters:
-            -
-                connection_string: 'sqlite::memory:'
-                queue: payments_antifraud
-
-    payments-init:
-        class: PHPQueue\Backend\PDO
-        constructor-parameters:
-            -
-                connection_string: 'sqlite::memory:'
-                queue: payments_init
-
-    pending:
-        <<: *QUEUE
-
-    recurring:
-        <<: *QUEUE
-
-    refund:
-        <<: *QUEUE
-
-    jobs-paypal:
-        class: PHPQueue\Backend\PDO
-        constructor-parameters:
-            -
-                connection_string: 'sqlite::memory:'
-                queue: jobs_paypal
-
-    jobs-adyen:
-        class: PHPQueue\Backend\PDO
-        constructor-parameters:
-            -
-                connection_string: 'sqlite::memory:'
-                queue: jobs_adyen
-
-    donations:
-        <<: *QUEUE
-
-    pending-db:
-        <<: *DB
-
-    damaged-db:
-        <<: *DB
-
-    fredge-db:
-        <<: *DB

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0445b229c4723113d505644c26bf77c922542764
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg <ej...@ejegg.com>

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

Reply via email to