Skip to content

Commit 8543e0a

Browse files
committed
Load DBI into container only when needed by the test
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 4888465 commit 8543e0a

6 files changed

Lines changed: 14 additions & 1 deletion

File tree

test/classes/AbstractTestCase.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ protected function setUp(): void
9898
$this->setGlobalConfig();
9999
$this->loadContainerBuilder();
100100
$this->setGlobalDbi();
101-
$this->loadDbiIntoContainerBuilder();
102101
$this->setTheme();
103102
Cache::purge();
104103
}

test/classes/Controllers/Export/ExportControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class ExportControllerTest extends AbstractTestCase
2727
{
2828
public function testExportController(): void
2929
{
30+
parent::loadDbiIntoContainerBuilder();
31+
3032
$GLOBALS['server'] = 1;
3133
$GLOBALS['text_dir'] = 'ltr';
3234
$GLOBALS['lang'] = 'en';

test/classes/Controllers/Table/ExportControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class ExportControllerTest extends AbstractTestCase
2222
{
2323
public function testExportController(): void
2424
{
25+
parent::loadDbiIntoContainerBuilder();
26+
2527
$GLOBALS['db'] = 'test_db';
2628
$GLOBALS['table'] = 'test_table';
2729
$GLOBALS['cfg']['Server'] = $GLOBALS['config']->defaultServer;

test/classes/Export/OptionsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ protected function setUp(): void
2727
parent::setUp();
2828
parent::setLanguage();
2929
parent::setGlobalConfig();
30+
parent::loadDbiIntoContainerBuilder();
31+
3032
$GLOBALS['cfg']['Server']['host'] = 'localhost';
3133
$GLOBALS['cfg']['Server']['user'] = 'pma_user';
3234
$GLOBALS['server'] = 0;

test/classes/PluginsTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
*/
1515
class PluginsTest extends AbstractTestCase
1616
{
17+
protected function setUp(): void
18+
{
19+
parent::setUp();
20+
parent::loadDbiIntoContainerBuilder();
21+
}
22+
1723
public function testGetExport(): void
1824
{
1925
$GLOBALS['server'] = 1;

test/classes/TrackerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class TrackerTest extends AbstractTestCase
2323
protected function setUp(): void
2424
{
2525
parent::setUp();
26+
parent::loadDbiIntoContainerBuilder();
27+
2628
/**
2729
* SET these to avoid undefined index error
2830
*/

0 commit comments

Comments
 (0)