-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from mschindler83/test-env-refactoring
Test env refactoring and smaller BC code changes
- Loading branch information
Showing
44 changed files
with
437 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
language: php | ||
php: | ||
- 5.6 | ||
- 5.5 | ||
- 5.4 | ||
- 5.3 | ||
- hhvm | ||
|
||
script: ant test | ||
env: | ||
|
||
script: | ||
- ant test | ||
- ant test-integration | ||
|
||
env: | ||
global: | ||
secure: "StaRWxgVW55YXMetUfL91rGDHJCBC0e3Nv9qYx5jg2aa9H0BIYhJ8vYtDXbKFEeGXWRnlLdPVclzRiIMdYQTZaBrjHxWVzE9N5stIyIq/Ik5hvkRs3h78ICSsDJB7SAun+aYv4vV/2kR44B0YiOhWZehV3IhAWO1Csd4HDjiQHY=" | ||
- secure: "StaRWxgVW55YXMetUfL91rGDHJCBC0e3Nv9qYx5jg2aa9H0BIYhJ8vYtDXbKFEeGXWRnlLdPVclzRiIMdYQTZaBrjHxWVzE9N5stIyIq/Ik5hvkRs3h78ICSsDJB7SAun+aYv4vV/2kR44B0YiOhWZehV3IhAWO1Csd4HDjiQHY=" | ||
- PAYMILL_API_TEST_KEY: 0dcb0c6a3dcddace93de405fb98857b7 | ||
- PAYMILL_API_PUBLIC_TEST_KEY: 07558773223ff498c4ab0ca581551453 | ||
|
||
matrix: | ||
include: | ||
- php: 5.6 | ||
env: PAYMILL_WH_1=transaction.succeeded PAYMILL_WH_2=subscription.created | ||
- php: 5.5 | ||
env: PAYMILL_WH_1=chargeback.executed PAYMILL_WH_2=transaction.created | ||
- php: 5.4 | ||
env: PAYMILL_WH_1=transaction.pending PAYMILL_WH_2=transaction.failed | ||
- php: 5.3 | ||
env: PAYMILL_WH_1=client.updated PAYMILL_WH_2=subscription.updated | ||
- php: hhvm | ||
env: PAYMILL_WH_1=subscription.deleted PAYMILL_WH_2=subscription.succeeded | ||
|
||
before_install: composer self-update | ||
install: composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Paymill\Tests\Integration; | ||
|
||
use Paymill\API\Curl; | ||
use Paymill\Request; | ||
|
||
class IntegrationBase extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var Request | ||
*/ | ||
protected $_service; | ||
|
||
/** | ||
* Prepares the environment before running a test. | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->_service = new Request(); | ||
$this->_service->setConnectionClass( | ||
new Curl(API_TEST_KEY, API_HOST, array(CURLOPT_SSL_VERIFYPEER => SSL_VERIFY_PEER)) | ||
); | ||
|
||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* Cleans up the environment after running a test. | ||
*/ | ||
protected function tearDown() | ||
{ | ||
$this->_service = null; | ||
parent::tearDown(); | ||
} | ||
|
||
public function createToken() | ||
{ | ||
$params = array( | ||
'channel_id' => API_PUBLIC_TEST_KEY, | ||
'transaction_mode' => 'CONNECTOR_TEST', | ||
'account_number' => '4111111111111111', | ||
'account_holder' => 'Max Muster', | ||
'account_expiry_month' => '12', | ||
'account_expiry_year' => date('Y', strtotime('+1 year')), | ||
|
||
); | ||
$token = json_decode(file_get_contents(TOKEN_HOST . '?' . http_build_query($params)), true); | ||
if (isset($token['transaction']['identification']['uniqueId'])) { | ||
return $token['transaction']['identification']['uniqueId']; | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.