|
6 | 6 |
|
7 | 7 | use PhpMyAdmin\Application; |
8 | 8 | use PhpMyAdmin\Config; |
| 9 | +use PhpMyAdmin\Core; |
9 | 10 | use PhpMyAdmin\ErrorHandler; |
10 | 11 | use PhpMyAdmin\Exceptions\ConfigException; |
11 | 12 | use PhpMyAdmin\Http\Factory\ResponseFactory; |
12 | 13 | use PhpMyAdmin\Template; |
13 | 14 | use PHPUnit\Framework\Attributes\BackupStaticProperties; |
14 | 15 | use PHPUnit\Framework\Attributes\CoversClass; |
15 | | -use Psr\Http\Message\ResponseFactoryInterface; |
16 | | -use Symfony\Component\DependencyInjection\ContainerBuilder; |
17 | 16 |
|
18 | 17 | #[CoversClass(Application::class)] |
19 | 18 | final class ApplicationTest extends AbstractTestCase |
20 | 19 | { |
21 | 20 | public function testInit(): void |
22 | 21 | { |
23 | | - $application = new Application( |
24 | | - $this->createStub(ErrorHandler::class), |
25 | | - $this->createStub(Config::class), |
26 | | - $this->createStub(Template::class), |
27 | | - new ResponseFactory($this->createStub(ResponseFactoryInterface::class)), |
28 | | - ); |
29 | | - $container = $this->createMock(ContainerBuilder::class); |
30 | | - $container->expects($this->once())->method('get') |
31 | | - ->with($this->identicalTo(Application::class))->willReturn($application); |
32 | | - $GLOBALS['containerBuilder'] = $container; |
33 | | - $this->assertSame($application, Application::init()); |
| 22 | + $GLOBALS['containerBuilder'] = null; |
| 23 | + $application = Core::getContainerBuilder()->get(Application::class); |
| 24 | + self::assertInstanceOf(Application::class, $application); |
| 25 | + self::assertSame($application, Application::init()); |
| 26 | + $GLOBALS['containerBuilder'] = null; |
34 | 27 | } |
35 | 28 |
|
36 | 29 | #[BackupStaticProperties(true)] |
|
0 commit comments