-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 2.0: [FrameworkBundle] added support for URIs as an argument to HttpKernel::render() [FrameworkBundle] restricted the type of controllers that can be executed by InternalController Making it easier to grab the PR template. fix double-decoding in the routing system Conflicts: README.md src/Symfony/Bundle/FrameworkBundle/EventListener/RouterListener.php src/Symfony/Component/Security/Http/HttpUtils.php
- Loading branch information
Showing
5 changed files
with
96 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/Symfony/Bundle/FrameworkBundle/Tests/Controller/InternalControllerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?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\FrameworkBundle\Tests\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\InternalController; | ||
use Symfony\Bundle\FrameworkBundle\Tests\TestCase; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class InternalControllerTest extends TestCase | ||
{ | ||
/** | ||
* @expectedException \RuntimeException | ||
* @expectedExceptionMessage A Controller class name must end with Controller. | ||
*/ | ||
public function testWithAClassMethodController() | ||
{ | ||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); | ||
|
||
$controller = new InternalController(); | ||
$controller->setContainer($container); | ||
|
||
$controller->indexAction('/', 'Symfony\Component\HttpFoundation\Request::getPathInfo'); | ||
} | ||
|
||
/** | ||
* @expectedException \RuntimeException | ||
* @expectedExceptionMessage A Controller class name must end with Controller. | ||
*/ | ||
public function testWithAServiceController() | ||
{ | ||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); | ||
$container | ||
->expects($this->once()) | ||
->method('get') | ||
->will($this->returnValue(new Request())) | ||
; | ||
|
||
$controller = new InternalController(); | ||
$controller->setContainer($container); | ||
|
||
$controller->indexAction('/', 'service:method'); | ||
} | ||
} |