mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
add api client to main repository
This commit is contained in:
parent
7c5638764e
commit
f5bb4048cd
100 changed files with 10765 additions and 2 deletions
46
tests/PHPUnit/ApiClient/Entity/PaymentsTest.php
Normal file
46
tests/PHPUnit/ApiClient/Entity/PaymentsTest.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Inpsyde\PayPalCommerce\ApiClient\Entity;
|
||||
|
||||
use Inpsyde\PayPalCommerce\ApiClient\TestCase;
|
||||
|
||||
class PaymentsTest extends TestCase
|
||||
{
|
||||
public function testAuthorizations()
|
||||
{
|
||||
$authorization = \Mockery::mock(Authorization::class);
|
||||
$authorizations = [$authorization];
|
||||
|
||||
$testee = new Payments(...$authorizations);
|
||||
|
||||
$this->assertEquals($authorizations, $testee->authorizations());
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
{
|
||||
$authorization = \Mockery::mock(Authorization::class);
|
||||
$authorization->shouldReceive('toArray')->andReturn(
|
||||
[
|
||||
'id' => 'foo',
|
||||
'status' => 'CREATED',
|
||||
]
|
||||
);
|
||||
$authorizations = [$authorization];
|
||||
|
||||
$testee = new Payments(...$authorizations);
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
'authorizations' => [
|
||||
[
|
||||
'id' => 'foo',
|
||||
'status' => 'CREATED',
|
||||
],
|
||||
],
|
||||
],
|
||||
$testee->toArray()
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue