From f092331eb191634ca667f72e38081ae2ddd7ba3c Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Thu, 5 Sep 2019 11:34:38 -0400 Subject: [PATCH] Fix 4.3 tests forward compat --- .../Tests/Functional/MissingUserProviderTest.php | 9 ++++++--- .../Tests/Functional/app/MissingUserProvider/bundles.php | 1 + .../Tests/Functional/app/MissingUserProvider/config.yml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/MissingUserProviderTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/MissingUserProviderTest.php index 6231bde641..d795980b3e 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/MissingUserProviderTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/MissingUserProviderTest.php @@ -15,13 +15,16 @@ class MissingUserProviderTest extends AbstractWebTestCase { public function testUserProviderIsNeeded() { - $this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException'); - $this->expectExceptionMessage('"default" firewall requires a user provider but none was defined.'); - $client = $this->createClient(['test_case' => 'MissingUserProvider', 'root_config' => 'config.yml']); + $client = $this->createClient(['test_case' => 'MissingUserProvider', 'root_config' => 'config.yml', 'debug' => true]); $client->request('GET', '/', [], [], [ 'PHP_AUTH_USER' => 'username', 'PHP_AUTH_PW' => 'pa$$word', ]); + + $response = $client->getResponse(); + $this->assertSame(500, $response->getStatusCode()); + $this->stringContains('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException', $response->getContent()); + $this->stringContains('"default" firewall requires a user provider but none was defined.', $response->getContent()); } } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/bundles.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/bundles.php index ccff0d356c..cb3ed2b05f 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/bundles.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/bundles.php @@ -16,5 +16,6 @@ use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\MissingUserProviderBun return [ new FrameworkBundle(), new SecurityBundle(), + new Symfony\Bundle\TwigBundle\TwigBundle(), new MissingUserProviderBundle(), ]; diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/config.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/config.yml index 501a673b4f..52f9948da2 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/config.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/config.yml @@ -1,5 +1,5 @@ imports: - - { resource: ./../config/framework.yml } + - { resource: ./../config/default.yml } security: firewalls: