mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
66 lines
1.4 KiB
PHP
66 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.4
|
|
*
|
|
* @package tests
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link https://orange-management.org
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace phpOMS\tests\Auth\OAuth2\Grant;
|
|
|
|
use phpOMS\Auth\OAuth2\Grant\AuthorizationCode;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
class AuthorizationCodeTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
private AuthorizationCode $grant;
|
|
|
|
protected function setUp() : void
|
|
{
|
|
$this->grant = new AuthorizationCode();
|
|
}
|
|
|
|
public function testDefault() : void
|
|
{
|
|
self::assertEquals('authorization_code', $this->grant->__toString());
|
|
self::assertEquals(
|
|
[
|
|
'code' => 'value',
|
|
'option' => '2',
|
|
'test' => 'value2',
|
|
],
|
|
$this->grant->prepareRequestParamters(
|
|
[
|
|
'code' => 'value',
|
|
],
|
|
[
|
|
'option' => '2',
|
|
'test' => 'value2',
|
|
]
|
|
)
|
|
);
|
|
}
|
|
|
|
public function testMissingDefaultOption() : void
|
|
{
|
|
$this->expectException(\Exception::class);
|
|
$this->grant->prepareRequestParamters(
|
|
[
|
|
'test' => 'value',
|
|
],
|
|
[
|
|
'option' => '2',
|
|
'test' => 'value2',
|
|
]
|
|
);
|
|
}
|
|
}
|