mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
|
<?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()
|
||
|
);
|
||
|
}
|
||
|
}
|