8000 Duplicate logic for test · symfony/symfony@0fa35ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 0fa35ae

Browse files
committed
Duplicate logic for test
1 parent 64e8f9c commit 0fa35ae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,13 @@ public function testGetControllerInvokableService()
101101
*/
102102
public function testGetControllerOnNonUndefinedFunction($controller, $exceptionName = null, $exceptionMessage = null)
103103
{
104+
// All this logic needs to be duplicated, since calling parent::testGetControllerOnNonUndefinedFunction will override the expected excetion and not use the regex
105+
$resolver = $this->createControllerResolver();
104106
$this->setExpectedExceptionRegExp($exceptionName, $exceptionMessage);
105-
parent::testGetControllerOnNonUndefinedFunction($controller, $exceptionName, $exceptionMessage);
107+
108+
$request = Request::create('/');
109+
$request->attributes->set('_controller', $controller);
110+
$resolver->getController($request);
106111
}
107112

108113
public function getUndefinedControllers()

0 commit comments

Comments
 (0)
0