Skip to content

Commit

Permalink
[AdminBundle] Fix remaining usages of deprecated admin_exception_excl…
Browse files Browse the repository at this point in the history
…udes config
  • Loading branch information
acrobat committed Jul 20, 2021
1 parent 96ae88c commit d598482
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public function load(array $configs, ContainerBuilder $container)

$container->setParameter('kunstmaan_admin.admin_prefix', $this->normalizeUrlSlice($config['admin_prefix']));

$container->setParameter('kunstmaan_admin.admin_exception_excludes', $config['admin_exception_excludes']);
$exceptionExcludes = !empty($config['exception_logging']['exclude_patterns']) ? $config['exception_logging']['exclude_patterns'] : $config['admin_exception_excludes'];
$container->setParameter('kunstmaan_admin.admin_exception_excludes', $exceptionExcludes);

$container->setParameter('kunstmaan_admin.google_signin.enabled', $config['google_signin']['enabled']);
$container->setParameter('kunstmaan_admin.google_signin.client_id', $config['google_signin']['client_id']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,51 @@ public function testLegacyParameters()
$this->assertContainerBuilderHasParameter('kunstmaan_admin.default_locale', '');
}

/**
* @group legacy
*/
public function testDeprecatedExceptionExcludes()
{
$this->load(array_merge($this->getRequiredConfig(), [
'authentication' => [
'enable_new_authentication' => true,
],
'admin_exception_excludes' => [
'test_exclude',
],
]));

$this->assertContainerBuilderHasParameter('kunstmaan_admin.admin_exception_excludes', ['test_exclude']);
}

/**
* @group legacy
*/
public function testDeprecatedExceptionExcludesWithNewConfig()
{
$this->load(array_merge($this->getRequiredConfig(), [
'admin_exception_excludes' => [
'test_exclude',
],
'exception_logging' => [
'exclude_patterns' => ['test_exclude_new_config'],
],
]));

$this->assertContainerBuilderHasParameter('kunstmaan_admin.admin_exception_excludes', ['test_exclude_new_config']);
}

public function testExceptionExcludesFromExceptionLoggingConfig()
{
$this->load(array_merge($this->getRequiredConfig(), [
'exception_logging' => [
'exclude_patterns' => ['test_exclude_new_config'],
],
]));

$this->assertContainerBuilderHasParameter('kunstmaan_admin.admin_exception_excludes', ['test_exclude_new_config']);
}

protected function setUp(): void
{
parent::setUp();
Expand Down

0 comments on commit d598482

Please sign in to comment.