You are here

public function ControllerResolverTest::testCreateControllerCanReturnAnyCallable in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/Controller/ControllerResolverTest.php \Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest::testCreateControllerCanReturnAnyCallable()

File

vendor/symfony/http-kernel/Tests/Controller/ControllerResolverTest.php, line 200

Class

ControllerResolverTest

Namespace

Symfony\Component\HttpKernel\Tests\Controller

Code

public function testCreateControllerCanReturnAnyCallable() {
  $mock = $this
    ->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', array(
    'createController',
  ));
  $mock
    ->expects($this
    ->once())
    ->method('createController')
    ->will($this
    ->returnValue('Symfony\\Component\\HttpKernel\\Tests\\Controller\\some_controller_function'));
  $request = Request::create('/');
  $request->attributes
    ->set('_controller', 'foobar');
  $mock
    ->getController($request);
}