Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ca4507

Browse files
committed
[AccessToken] should fix last failing tests
1 parentd947815 commit7ca4507

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
usePsr\Log\LogLevel;
1616
useSeld\JsonLint\JsonParser;
1717
useSymfony\Bundle\FullStack;
18+
useSymfony\Component\AccessToken\CredentialsInterface;
1819
useSymfony\Component\Asset\Package;
1920
useSymfony\Component\AssetMapper\AssetMapper;
2021
useSymfony\Component\Cache\Adapter\DoctrineAdapter;
@@ -156,7 +157,7 @@ public function getConfigTreeBuilder(): TreeBuilder
156157
$this->addRouterSection($rootNode);
157158
$this->addSessionSection($rootNode);
158159
$this->addRequestSection($rootNode);
159-
$this->addAccessTokenSection($rootNode);
160+
$this->addAccessTokenSection($rootNode,$enableIfStandalone);
160161
$this->addAssetsSection($rootNode,$enableIfStandalone);
161162
$this->addAssetMapperSection($rootNode,$enableIfStandalone);
162163
$this->addTranslatorSection($rootNode,$enableIfStandalone);
@@ -723,12 +724,13 @@ private function addRequestSection(ArrayNodeDefinition $rootNode): void
723724
;
724725
}
725726

726-
privatefunctionaddAccessTokenSection(ArrayNodeDefinition$rootNode):void
727+
privatefunctionaddAccessTokenSection(ArrayNodeDefinition$rootNode,callable$enableIfStandalone):void
727728
{
728729
$rootNode
729730
->children()
730731
->arrayNode('access_token')
731732
->info('access token manager configuration')
733+
->{$enableIfStandalone('symfony/access-token', CredentialsInterface::class)}()
732734
->canBeEnabled()
733735
->children()
734736
->arrayNode('lock')

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
usePHPUnit\Framework\TestCase;
1616
useSymfony\Bundle\FrameworkBundle\DependencyInjection\Configuration;
1717
useSymfony\Bundle\FullStack;
18+
useSymfony\Component\AccessToken\CredentialsInterface;
1819
useSymfony\Component\Cache\Adapter\DoctrineAdapter;
1920
useSymfony\Component\Config\Definition\Exception\InvalidConfigurationException;
2021
useSymfony\Component\Config\Definition\Processor;
@@ -752,6 +753,14 @@ protected static function getBundleDefaultConfig()
752753
'enabled' =>false,
753754
'formats' => [],
754755
],
756+
'access_token' => [
757+
'enabled' => !class_exists(FullStack::class) &&interface_exists(CredentialsInterface::class),
758+
'lock' => [
759+
'enabled' =>true,
760+
'ttl' =>5,
761+
],
762+
'credentials' => [],
763+
],
755764
'assets' => [
756765
'enabled' => !class_exists(FullStack::class),
757766
'version_strategy' =>null,

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,10 @@ public function testEmptyRequestFormats()
695695

696696
publicfunctiontestAccessToken()
697697
{
698+
if (!interface_exists(CredentialsInterface::class)) {
699+
$this->markTestSkipped('AccessToken not available.');
700+
}
701+
698702
$container =$this->createContainerFromFile('access_token');
699703

700704
$this->assertTrue($container->hasDefinition('access_token.manager'));
@@ -711,13 +715,21 @@ public function testAccessToken()
711715

712716
publicfunctiontestAccessTokenDisabled()
713717
{
718+
if (!interface_exists(CredentialsInterface::class)) {
719+
$this->markTestSkipped('AccessToken not available.');
720+
}
721+
714722
$container =$this->createContainerFromFile('access_token_disabled');
715723

716724
$this->assertFalse($container->hasDefinition('access_token.manager'));
717725
}
718726

719727
publicfunctiontestAccessTokenNoLock()
720728
{
729+
if (!interface_exists(CredentialsInterface::class)) {
730+
$this->markTestSkipped('AccessToken not available.');
731+
}
732+
721733
$container =$this->createContainerFromFile('access_token_no_lock');
722734

723735
$this->assertTrue($container->hasDefinition('access_token.manager'));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp