woocommerce-paypal-payments/tests/PHPUnit/ApiClient/Entity/AuthorizationTest.php
2020-08-31 13:38:54 +03:00

33 lines
907 B
PHP

<?php
declare(strict_types=1);
namespace Inpsyde\PayPalCommerce\ApiClient\Entity;
use Inpsyde\PayPalCommerce\ApiClient\TestCase;
class AuthorizationTest extends TestCase
{
public function testIdAndStatus()
{
$authorizationStatus = \Mockery::mock(AuthorizationStatus::class);
$testee = new Authorization('foo', $authorizationStatus);
$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);
$expected = [
'id' => 'foo',
'status' => 'CAPTURED',
];
$this->assertEquals($expected, $testee->toArray());
}
}