mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Test for Authorization
This commit is contained in:
parent
68e4e5a3ae
commit
0494b5e71e
1 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,33 @@
|
|||
<?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());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue