mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
enable refunds through gateway
This commit is contained in:
parent
a609b6f90b
commit
d6abaafadb
14 changed files with 775 additions and 37 deletions
|
@ -8,15 +8,24 @@ use WooCommerce\PayPalCommerce\ApiClient\TestCase;
|
|||
|
||||
class PaymentsTest extends TestCase
|
||||
{
|
||||
public function testAuthorizations()
|
||||
{
|
||||
$authorization = \Mockery::mock(Authorization::class);
|
||||
$authorizations = [$authorization];
|
||||
public function testAuthorizations()
|
||||
{
|
||||
$authorization = \Mockery::mock(Authorization::class);
|
||||
$authorizations = [$authorization];
|
||||
|
||||
$testee = new Payments(...$authorizations);
|
||||
$testee = new Payments($authorizations, []);
|
||||
|
||||
$this->assertEquals($authorizations, $testee->authorizations());
|
||||
}
|
||||
$this->assertEquals($authorizations, $testee->authorizations());
|
||||
}
|
||||
public function testCaptures()
|
||||
{
|
||||
$capture = \Mockery::mock(Capture::class);
|
||||
$captures = [$capture];
|
||||
|
||||
$testee = new Payments([], $captures);
|
||||
|
||||
$this->assertEquals($captures, $testee->captures());
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
{
|
||||
|
@ -27,9 +36,17 @@ class PaymentsTest extends TestCase
|
|||
'status' => 'CREATED',
|
||||
]
|
||||
);
|
||||
$capture = \Mockery::mock(Capture::class);
|
||||
$capture->shouldReceive('to_array')->andReturn(
|
||||
[
|
||||
'id' => 'capture',
|
||||
'status' => 'CREATED',
|
||||
]
|
||||
);
|
||||
$captures = [$capture];
|
||||
$authorizations = [$authorization];
|
||||
|
||||
$testee = new Payments(...$authorizations);
|
||||
$testee = new Payments($authorizations, $captures);
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
|
@ -39,6 +56,12 @@ class PaymentsTest extends TestCase
|
|||
'status' => 'CREATED',
|
||||
],
|
||||
],
|
||||
'captures' => [
|
||||
[
|
||||
'id' => 'capture',
|
||||
'status' => 'CREATED',
|
||||
],
|
||||
],
|
||||
],
|
||||
$testee->to_array()
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue