Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PW-2409] Add integration tests to continuous integration #198

Merged
merged 3 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run test suite
- name: Run integration tests
run: vendor/bin/phpunit --testsuite=integration --no-coverage
env:
INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }}
INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }}
INTEGRATION_X_API_KEY: ${{ secrets.INTEGRATION_X_API_KEY }}
INTEGRATION_MERCHANT_ACCOUNT: ${{ secrets.INTEGRATION_MERCHANT_ACCOUNT }}
INTEGRATION_SKIN_CODE: ${{ secrets.INTEGRATION_SKIN_CODE }}
INTEGRATION_HMAC_SIGNATURE: ${{ secrets.INTEGRATION_HMAC_SIGNATURE }}
INTEGRATION_STORE_PAYOUT_USERNAME: ${{ secrets.INTEGRATION_STORE_PAYOUT_USERNAME }}
INTEGRATION_STORE_PAYOUT_PASSWORD: ${{ secrets.INTEGRATION_STORE_PAYOUT_PASSWORD }}
INTEGRATION_REVIEW_PAYOUT_USERNAME: ${{ secrets.INTEGRATION_REVIEW_PAYOUT_USERNAME }}
INTEGRATION_REVIEW_PAYOUT_PASSWORD: ${{ secrets.INTEGRATION_REVIEW_PAYOUT_PASSWORD }}

- name: Run unit tests
run: vendor/bin/phpunit --testsuite=unit --coverage-clover build/clover.xml --log-junit build/tests-log.xml

# PHPUnit generates absolute file paths and SonarCloud expects relative file paths. This command removes the
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<testsuite name="unit">
<directory>./tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory>./tests/Integration</directory>
</testsuite>
<testsuite name="all">
<directory>./tests</directory>
</testsuite>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
*
*/

namespace Adyen;
namespace Adyen\Integration;

use Adyen\Util\Util;
use Adyen\TestCase;
use Adyen\Service;

class BinLookupTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
*
*/

namespace Adyen;
namespace Adyen\Integration;

use Adyen\TestCase;
use Adyen\Service;
use Adyen\Util\Uuid;

class CheckoutTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen API Library for PHP
*
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
*/

namespace Adyen\Integration;

namespace Adyen;
use Adyen\TestCase;
use Adyen\Service;

/**
* Created by PhpStorm.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
*
*/

namespace Adyen;
namespace Adyen\Integration;

use Adyen\TestCase;
use Adyen\Service;
use Adyen\Util\Util;

class DirectoryLookupTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen API Library for PHP
*
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
*/

/**
* Created by PhpStorm.
* User: rikt
* Date: 11/18/15
* Time: 12:01 PM
*/

namespace Adyen;
namespace Adyen\Integration;

use Adyen\TestCase;
use Adyen\Service;

class ExceptionTest extends \Adyen\TestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen API Library for PHP
*
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
*/

/**
* Created by PhpStorm.
* User: rikt
* Date: 11/6/15
* Time: 2:39 PM
*/

namespace Adyen;
namespace Adyen\Integration;

use Adyen\TestCase;
use Adyen\Service;

class ModificationTest extends TestCase
{
public function testCancelModification()
{
// create a payment
require_once __DIR__.'/CreatePaymentRequestTest.php';
require_once __DIR__ . '/CreatePaymentRequestTest.php';
$test = new CreatePaymentRequestTest();
$result = $test->testCreatePaymentSuccess();

Expand All @@ -33,7 +58,7 @@ public function testCancelModification()
public function testRefundModification()
{
// create a payment
require_once __DIR__.'/CreatePaymentRequestTest.php';
require_once __DIR__ . '/CreatePaymentRequestTest.php';
$test = new CreatePaymentRequestTest();
$result = $test->testCreatePaymentSuccess();

Expand Down Expand Up @@ -63,7 +88,7 @@ public function testRefundModification()
public function testAdjustDecreaseModification()
{
// create a payment
require_once __DIR__.'/CreatePaymentRequestTest.php';
require_once __DIR__ . '/CreatePaymentRequestTest.php';
$test = new CreatePaymentRequestTest();
$result = $test->testCreatePaymentSuccess();

Expand All @@ -90,7 +115,7 @@ public function testAdjustDecreaseModification()
public function testAdjustIncreaseModification()
{
// create a payment
require_once __DIR__.'/CreatePaymentRequestTest.php';
require_once __DIR__ . '/CreatePaymentRequestTest.php';
$test = new CreatePaymentRequestTest();
$result = $test->testCreatePaymentSuccess();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,23 @@
*
*/

namespace Adyen;
namespace Adyen\Integration;

use Adyen\TestCase;
use Adyen\Service;

/**
* Class PayoutThirdPartyTest
*
* @package Adyen\Integration
*/
class PayoutThirdPartyTest extends TestCase
{
protected function setUp(): void
{
$this->markTestIncomplete('Configure Payout accounts');
}

public function testStoreDetailAndSubmitPayoutThirdPartyMissingReference()
{
// initialize client
Expand Down Expand Up @@ -326,7 +339,7 @@ public function testConfirmPayoutThirdPartyInvalidReference()
// check if exception is correct
$this->assertEquals('Adyen\AdyenException', get_class($e));
$this->assertEquals(
'Invalid Request: Original pspReference is invalid for this environment!',
'Original pspReference required for this operation',
$e->getMessage()
);
}
Expand Down Expand Up @@ -367,7 +380,7 @@ public function testDeclinePayoutThirdPartySuccess()
public function testDeclinePayoutThirdPartyInvalidReference()
{
$this->expectException('Adyen\AdyenException');
$this->expectExceptionMessage('Invalid Request: Original pspReference is invalid for this environment!');
$this->expectExceptionMessage('Original pspReference required for this operation');
// initialize client
$client = $this->createReviewPayoutClient();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
<?php

namespace Adyen;

use Adyen\Util\Util;
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen API Library for PHP
*
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
*/

namespace Adyen\Integration;

use Adyen\TestCase;
use Adyen\Service;

class PosPaymentTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen API Library for PHP
*
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
*/

/**
* Created by PhpStorm.
* User: rikt
* Date: 11/6/15
* Time: 1:07 PM
*/

namespace Adyen;
namespace Adyen\Integration;

use Adyen\TestCase;
use Adyen\Service;

class RecurringTest extends TestCase
{
Expand Down
Loading