mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
46 lines
1.1 KiB
PHP
46 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()
|
|
);
|
|
}
|
|
}
|