Commit a29f5770 authored by Igor Wiedler's avatar Igor Wiedler

add functional test for route setting

parent 971e581d
<?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Silex\Tests;
use Silex\Application;
/**
* Controller test cases.
*
* @author Igor Wiedler <igor@wiedler.ch>
*/
class FunctionalTest extends \PHPUnit_Framework_TestCase
{
public function testSetRouteName()
{
$application = new Application();
$application->get('/', function() {
return 'hello';
})
->setRouteName('homepage');
$application->get('/foo', function() {
return 'foo';
})
->setRouteName('foo_abc');
$application->getControllerCollection()->flush();
$routeCollection = $application->getRouteCollection();
$this->assertInstanceOf('Symfony\Component\Routing\Route', $routeCollection->get('homepage'));
$this->assertInstanceOf('Symfony\Component\Routing\Route', $routeCollection->get('foo_abc'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment