8000 minor #29602 [DX] rename unit test controller (frankdejonge) · symfony/symfony@509d952 · GitHub
[go: up one dir, main page]

Skip to content

Commit 509d952

Browse files
minor #29602 [DX] rename unit test controller (frankdejonge)
This PR was merged into the 3.4 branch. Discussion ---------- [DX] rename unit test controller | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? |no | New feature? |no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Whenever I create a new controller the actually needed controller shows up second in the list of auto-completion. The first suggestion is a class defined in the test and should not ever be extended in the application. This PR renames it so that doesn't happen anymore. Example of the autocomplete issue: <img width="748" alt="screenshot 2018-12-14 at 10 33 26" src="https://user-images.githubusercontent.com/534693/49995500-a09dca80-ff8c-11e8-80b5-18890ff058b1.png"> Commits ------- d4e426c Renamed test controller from Controller to TestController so it doesn't show up in the IDE autocomplete.
2 parents c718a8e + d4e426c commit 509d952

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function testHandleWhenTheControllerIsAClosure()
200200
public function testHandleWhenTheControllerIsAnObjectWithInvoke()
201201
{
202202
$dispatcher = new EventDispatcher();
203-
$kernel = $this->getHttpKernel($dispatcher, new Controller());
203+
$kernel = $this->getHttpKernel($dispatcher, new TestController());
204204

205205
$this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request()));
206206
}
@@ -216,15 +216,15 @@ public function testHandleWhenTheControllerIsAFunction()
216216
public function testHandleWhenTheControllerIsAnArray()
217217
{
218218
$dispatcher = new EventDispatcher();
219-
$kernel = $this->getHttpKernel($dispatcher, array(new Controller(), 'controller'));
219+
$kernel = $this->getHttpKernel($dispatcher, array(new TestController(), 'controller'));
220220

221221
$this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request()));
222222
}
223223

224224
public function testHandleWhenTheControllerIsAStaticArray()
225225
{
226226
$dispatcher = new EventDispatcher();
227-
$kernel = $this->getHttpKernel($dispatcher, array('Symfony\Component\HttpKernel\Tests\Controller', 'staticcontroller'));
227+
$kernel = $this->getHttpKernel($dispatcher, array('Symfony\Component\HttpKernel\Tests\TestController', 'staticcontroller'));
228228

229229
$this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request()));
230230
}
@@ -381,7 +381,7 @@ private function assertResponseEquals(Response $expected, Response $actual)
381381
}
382382
}
383383

384-
class Controller
384+
class TestController
385385
{
386386
public function __invoke()
387387
{

0 commit comments

Comments
 (0)
0