Skip to content

Commit c34b288

Browse files
[FrameworkBundle] Fix legacy test
1 parent 34b8c76 commit c34b288

File tree

2 files changed

+39
-24
lines changed

2 files changed

+39
-24
lines changed

Tests/Controller/ControllerResolverTest.php

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1717
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1818
use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver;
19+
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ContainerAwareController;
1920
use Symfony\Component\DependencyInjection\Container;
20-
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
2121
use Symfony\Component\DependencyInjection\ContainerInterface;
2222
use Symfony\Component\HttpFoundation\Request;
2323
use Symfony\Component\HttpKernel\Tests\Controller\ContainerControllerResolverTest;
@@ -183,29 +183,6 @@ protected function createMockContainer()
183183
}
184184
}
185185

186-
class ContainerAwareController implements ContainerAwareInterface
187-
{
188-
private ?ContainerInterface $container = null;
189-
190-
public function setContainer(?ContainerInterface $container): void
191-
{
192-
$this->container = $container;
193-
}
194-
195-
public function getContainer(): ?ContainerInterface
196-
{
197-
return $this->container;
198-
}
199-
200-
public function testAction()
201-
{
202-
}
203-
204-
public function __invoke()
205-
{
206-
}
207-
}
208-
209186
class DummyController extends AbstractController
210187
{
211188
public function getContainer(): Psr11ContainerInterface
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures;
13+
14+
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
15+
use Symfony\Component\DependencyInjection\ContainerInterface;
16+
17+
class ContainerAwareController implements ContainerAwareInterface
18+
{
19+
private ?ContainerInterface $container = null;
20+
21+
public function setContainer(?ContainerInterface $container): void
22+
{
23+
$this->container = $container;
24+
}
25+
26+
public function getContainer(): ?ContainerInterface
27+
{
28+
return $this->container;
29+
}
30+
31+
public function testAction()
32+
{
33+
}
34+
35+
public function __invoke()
36+
{
37+
}
38+
}

0 commit comments

Comments
 (0)