8000 Made some SecurityBundle tests case-insensitive to prepare for future Symfony versions by javiereguiluz · Pull Request #23852 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Made some SecurityBundle tests case-insensitive to prepare for future Symfony versions #23852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Only lowercase the service IDs
  • Loading branch information
javiereguiluz committed Aug 13, 2017
commit f2c6235b5aa4e0f2b3abfaaf8487ca9a0082cd2b
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ public function testFirewalls()
$configs[] = array_values($configDef->getArguments());
}

// transform all $configs values to lower case so tests are case-insensitive and
// they also work in newer Symfony versions where service IDs are case-sensitive
array_walk_recursive($configs, function (&$value) {
$value = is_string($value) ? strtolower($value) : $value;
});
// the IDs of the services are case sensitive or insensitive depending on
// the Symfony version. Transform them to lowercase to simplify tests.
$configs[0][2] = strtolower($configs[0][2]);
$configs[2][2] = strtolower($configs[2][2]);

$this->assertEquals(array(
array(
Expand Down Expand Up @@ -118,7 +117,7 @@ public function testFirewalls()
),
array(
'parameter' => '_switch_user',
'role' => 'role_allowed_to_switch',
'role' => 'ROLE_ALLOWED_TO_SWITCH',
),
),
array(
Expand Down
0