woocommerce-paypal-payments/tests/PHPUnit/ApiClient/Entity/PaymentsTest.php
2020-09-14 07:51:45 +03:00

46 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\ApiClient\Entity;
use WooCommerce\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('to_array')->andReturn(
[
'id' => 'foo',
'status' => 'CREATED',
]
);
$authorizations = [$authorization];
$testee = new Payments(...$authorizations);
$this->assertEquals(
[
'authorizations' => [
[
'id' => 'foo',
'status' => 'CREATED',
],
],
],
$testee->to_array()
);
}
}