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

Unit test for double path param substitution #518

Merged
merged 4 commits into from
Jul 14, 2023
Merged
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
11 changes: 11 additions & 0 deletions tests/Unit/CheckoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

use Adyen\AdyenException;
use Adyen\Service\Checkout;
use function PHPUnit\Framework\assertContains;
use function PHPUnit\Framework\assertEquals;

class CheckoutTest extends TestCaseMock
{
Expand Down Expand Up @@ -583,4 +585,13 @@ public static function successDeleteStoredPaymentMethodsProvider()
array('tests/Resources/Checkout/deleteStoredPaymentMethods-success.json', 200),
);
}

public function testDoublePathParamSubstitution()
{
$client = $this->createMockClientUrl('tests/Resources/ModelBasedCheckout/sessions-success.json');
$resource = new Checkout($client);
$resource->captures(array('paymentPspReference' => 'pspRef1'));
jillingk marked this conversation as resolved.
Show resolved Hide resolved
$resource->captures(array('paymentPspReference' => 'pspRef2'));
assertEquals($this->requestUrl, 'https://checkout-test.adyen.com/v70/payments/pspRef2/captures');
}
}