<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Bundle\SecurityBundle\Tests\Functional;

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'));

        $client->request('GET', '/', array(), array(), array(
            'PHP_AUTH_USER' => 'username',
            'PHP_AUTH_PW' => 'pa$$word',
        ));
    }
}
