8000 minor #33479 [SecurityBundle] Fix 4.3 tests forward compat (yceruto) · symfony/symfony@2feae7b · GitHub
[go: up one dir, main page]

Skip to content

Commit 2feae7b

Browse files
minor #33479 [SecurityBundle] Fix 4.3 tests forward compat (yceruto)
This PR was merged into the 4.3 branch. Discussion ---------- [SecurityBundle] Fix 4.3 tests forward compat | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #33478 | License | MIT | Doc PR | - Commits ------- f092331 Fix 4.3 tests forward compat
2 parents d081f16 + f092331 commit 2feae7b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/Functional/MissingUserProviderTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ class MissingUserProviderTest extends AbstractWebTestCase
1515
{
1616
public function testUserProviderIsNeeded()
1717
{
18-
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
19-
$this->expectExceptionMessage('"default" firewall requires a user provider but none was defined.');
20-
$client = $this->createClient(['test_case' => 'MissingUserProvider', 'root_config' => 'config.yml']);
18+
$client = $this->createClient(['test_case' => 'MissingUserProvider', 'root_config' => 'config.yml', 'debug' => true]);
2119

2220
$client->request('GET', '/', [], [], [
2321
'PHP_AUTH_USER' => 'username',
2422
'PHP_AUTH_PW' => 'pa$$word',
2523
]);
24+
25+
$response = $client->getResponse();
26+
$this->assertSame(500, $response->getStatusCode());
27+
$this->stringContains('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException', $response->getContent());
28+
$this->stringContains('"default" firewall requires a user provider but none was defined.', $response->getContent());
2629
}
2730
}

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/bundles.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
return [
1717
new FrameworkBundle(),
1818
new SecurityBundle(),
19+
new Symfony\Bundle\TwigBundle\TwigBundle(),
1920
new MissingUserProviderBundle(),
2021
];

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
imports:
2-
- { resource: ./../config/framework.yml }
2+
- { resource: ./../config/default.yml }
33

44
security:
55
firewalls:

0 commit comments

Comments
 (0)
0