add api client to main repository

This commit is contained in:
David Remer 2020-08-31 13:38:54 +03:00
parent 7c5638764e
commit f5bb4048cd
100 changed files with 10765 additions and 2 deletions

View file

@ -0,0 +1,46 @@
<?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()
);
}
}