mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
33 lines
918 B
PHP
33 lines
918 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace WooCommerce\PayPalCommerce\ApiClient\Entity;
|
|
|
|
use WooCommerce\PayPalCommerce\TestCase;
|
|
|
|
class AuthorizationTest extends TestCase
|
|
{
|
|
public function testIdAndStatus()
|
|
{
|
|
$authorizationStatus = \Mockery::mock(AuthorizationStatus::class);
|
|
$testee = new Authorization('foo', $authorizationStatus, null);
|
|
|
|
$this->assertEquals('foo', $testee->id());
|
|
$this->assertEquals($authorizationStatus, $testee->status());
|
|
}
|
|
|
|
public function testToArray()
|
|
{
|
|
$authorizationStatus = \Mockery::mock(AuthorizationStatus::class);
|
|
$authorizationStatus->expects('name')->andReturn('CAPTURED');
|
|
|
|
$testee = new Authorization('foo', $authorizationStatus, null);
|
|
|
|
$expected = [
|
|
'id' => 'foo',
|
|
'status' => 'CAPTURED',
|
|
];
|
|
$this->assertEquals($expected, $testee->to_array());
|
|
}
|
|
}
|