[SecurityBundle] Fix test

This commit is contained in:
Robin Chalas 2018-04-30 18:12:47 +02:00
parent feebe39efb
commit c93c9a5880

View File

@ -11,12 +11,10 @@
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
class MissingUserProviderTest extends WebTestCase
{
/**
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedExceptionMessage "default" firewall requires a user provider but none was defined.
*/
public function testUserProviderIsNeeded()
{
$client = $this->createClient(array('test_case' => 'MissingUserProvider', 'root_config' => 'config.yml'));
@ -25,5 +23,11 @@ class MissingUserProviderTest extends WebTestCase
'PHP_AUTH_USER' => 'username',
'PHP_AUTH_PW' => 'pa$$word',
));
$response = $client->getResponse();
$this->assertSame(500, $response->getStatusCode());
$this->assertContains(InvalidConfigurationException::class, $response->getContent());
$this->assertContains('"default" firewall requires a user provider but none was defined', htmlspecialchars_decode($response->getContent()));
}
}