for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2018 Spomky-Labs
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace OAuth2Framework\Component\ClientConfigurationEndpoint\Tests;
use OAuth2Framework\Component\Core\Client\ClientId;
use OAuth2Framework\Component\Core\DataBag\DataBag;
use PHPUnit\Framework\TestCase;
/**
* @group Tests
class ClientRegistrationManagementRuleTest extends TestCase
{
* @test
public function testClientRegistrationManagementRuleSetAsDefault()
$clientId = ClientId::create('CLIENT_ID');
$commandParameters = DataBag::create([]);
$rule = new ClientConfigurationRouteRule();
$validatedParameters = $rule->handle($clientId, $commandParameters, DataBag::create([]), $this->getCallable());
self::assertTrue($validatedParameters->has('registration_access_token'));
self::assertTrue($validatedParameters->has('registration_client_uri'));
self::assertEquals('https://www.example.com/client/CLIENT_ID', $validatedParameters->get('registration_client_uri'));
}
* @return callable
private function getCallable(): callable
return function (ClientId $clientId, DataBag $commandParameters, DataBag $validatedParameters): DataBag {
return $validatedParameters;
};