Skip to content

Commit

Permalink
Call parent's setUp and tearDown
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed May 20, 2020
1 parent 8ef5143 commit 6eaa55e
Show file tree
Hide file tree
Showing 184 changed files with 271 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/classes/AbstractTestCase.php
Expand Up @@ -12,6 +12,19 @@
*/
abstract class AbstractTestCase extends TestCase
{
/**
* Prepares environment for the test.
* Clean all variables
*/
protected function setUp(): void
{
}


/**
* Desctroys the environment built for the test.
* Clean all variables
*/
protected function tearDown(): void
{
}
}
1 change: 1 addition & 0 deletions test/classes/AdvisorTest.php
Expand Up @@ -21,6 +21,7 @@ class AdvisorTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['server'] = 1;
}
Expand Down
1 change: 1 addition & 0 deletions test/classes/BookmarkTest.php
Expand Up @@ -22,6 +22,7 @@ class BookmarkTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['cfg']['Server']['user'] = 'root';
$GLOBALS['cfg']['Server']['pmadb'] = 'phpmyadmin';
$GLOBALS['cfg']['Server']['bookmarktable'] = 'pma_bookmark';
Expand Down
1 change: 1 addition & 0 deletions test/classes/BrowseForeignersTest.php
Expand Up @@ -23,6 +23,7 @@ class BrowseForeignersTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['cfg']['LimitChars'] = 50;
$GLOBALS['cfg']['MaxRows'] = 25;
$GLOBALS['cfg']['RepeatCells'] = 100;
Expand Down
1 change: 1 addition & 0 deletions test/classes/CentralColumnsTest.php
Expand Up @@ -94,6 +94,7 @@ class CentralColumnsTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['cfg']['Server']['user'] = 'pma_user';
$GLOBALS['cfg']['Server']['DisableIS'] = true;
Expand Down
1 change: 1 addition & 0 deletions test/classes/CharsetsTest.php
Expand Up @@ -16,6 +16,7 @@ class CharsetsTest extends AbstractTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['cfg']['DBG']['sql'] = false;
$GLOBALS['cfg']['Server']['DisableIS'] = false;
}
Expand Down
1 change: 1 addition & 0 deletions test/classes/CheckUserPrivilegesTest.php
Expand Up @@ -22,6 +22,7 @@ class CheckUserPrivilegesTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 1;
$GLOBALS['cfg']['Server']['DisableIS'] = false;
$GLOBALS['col_priv'] = false;
Expand Down
2 changes: 2 additions & 0 deletions test/classes/Config/ConfigFileTest.php
Expand Up @@ -38,6 +38,7 @@ class ConfigFileTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 1;
$this->object = new ConfigFile();
}
Expand All @@ -47,6 +48,7 @@ protected function setUp(): void
*/
protected function tearDown(): void
{
parent::tearDown();
$this->object->setConfigData([]);
unset($this->object);
}
Expand Down
1 change: 1 addition & 0 deletions test/classes/Config/DescriptionTest.php
Expand Up @@ -21,6 +21,7 @@ class DescriptionTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
}

Expand Down
1 change: 1 addition & 0 deletions test/classes/Config/FormDisplayTemplateTest.php
Expand Up @@ -26,6 +26,7 @@ class FormDisplayTemplateTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$this->config = new Config();
$this->formDisplayTemplate = new FormDisplayTemplate($this->config);
}
Expand Down
2 changes: 2 additions & 0 deletions test/classes/Config/FormDisplayTest.php
Expand Up @@ -30,6 +30,7 @@ class FormDisplayTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['server'] = 0;
Expand All @@ -42,6 +43,7 @@ protected function setUp(): void
*/
protected function tearDown(): void
{
parent::tearDown();
unset($this->object);
}

Expand Down
2 changes: 2 additions & 0 deletions test/classes/Config/FormTest.php
Expand Up @@ -28,6 +28,7 @@ class FormTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['server'] = 0;
Expand All @@ -47,6 +48,7 @@ protected function setUp(): void
*/
protected function tearDown(): void
{
parent::tearDown();
unset($this->object);
}

Expand Down
1 change: 1 addition & 0 deletions test/classes/Config/Forms/FormListTest.php
Expand Up @@ -17,6 +17,7 @@ class FormListTest extends PmaTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['server'] = 1;
}
Expand Down
1 change: 1 addition & 0 deletions test/classes/Config/PageSettingsTest.php
Expand Up @@ -20,6 +20,7 @@ class PageSettingsTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['server'] = 1;
Expand Down
1 change: 1 addition & 0 deletions test/classes/Config/ServerConfigChecksTest.php
Expand Up @@ -27,6 +27,7 @@ class ServerConfigChecksTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['cfg']['AvailableCharsets'] = [];
$GLOBALS['cfg']['ServerDefault'] = 0;
Expand Down
1 change: 1 addition & 0 deletions test/classes/ConfigTest.php
Expand Up @@ -55,6 +55,7 @@ class ConfigTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$_SERVER['HTTP_USER_AGENT'] = '';
$this->object = new Config();
$GLOBALS['server'] = 0;
Expand Down
Expand Up @@ -60,6 +60,7 @@ class StructureControllerTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 1;
$GLOBALS['cfg']['Server']['DisableIS'] = false;
$GLOBALS['table'] = 'table';
Expand Down
1 change: 1 addition & 0 deletions test/classes/Controllers/Server/BinlogControllerTest.php
Expand Up @@ -25,6 +25,7 @@ class BinlogControllerTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -22,6 +22,7 @@ class CollationsControllerTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -25,6 +25,7 @@ class DatabasesControllerTest extends AbstractTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
1 change: 1 addition & 0 deletions test/classes/Controllers/Server/EnginesControllerTest.php
Expand Up @@ -25,6 +25,7 @@ class EnginesControllerTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
1 change: 1 addition & 0 deletions test/classes/Controllers/Server/PluginsControllerTest.php
Expand Up @@ -24,6 +24,7 @@ class PluginsControllerTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -30,6 +30,7 @@ class AdvisorControllerTest extends AbstractTestCase

protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -22,6 +22,7 @@ class MonitorControllerTest extends AbstractTestCase

protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -23,6 +23,7 @@ class ProcessesControllerTest extends AbstractTestCase

protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -24,6 +24,7 @@ class QueriesControllerTest extends AbstractTestCase

protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -20,6 +20,7 @@ class StatusControllerTest extends AbstractTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -21,6 +21,7 @@ class VariablesControllerTest extends AbstractTestCase

protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -27,6 +27,7 @@ class VariablesControllerTest extends AbstractTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
Expand Up @@ -15,6 +15,7 @@ class FindReplaceControllerTest extends AbstractTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
1 change: 1 addition & 0 deletions test/classes/Controllers/Table/IndexesControllerTest.php
Expand Up @@ -32,6 +32,7 @@ class IndexesControllerTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
/**
* SET these to avoid undefined index error
*/
Expand Down
1 change: 1 addition & 0 deletions test/classes/Controllers/Table/RelationControllerTest.php
Expand Up @@ -31,6 +31,7 @@ class RelationControllerTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 0;
$GLOBALS['db'] = 'db';
$GLOBALS['table'] = 'table';
Expand Down
1 change: 1 addition & 0 deletions test/classes/Controllers/Table/SearchControllerTest.php
Expand Up @@ -34,6 +34,7 @@ class SearchControllerTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
/**
* SET these to avoid undefined index error
*/
Expand Down
1 change: 1 addition & 0 deletions test/classes/Controllers/Table/StructureControllerTest.php
Expand Up @@ -38,6 +38,7 @@ class StructureControllerTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 1;
$GLOBALS['db'] = 'db';
$GLOBALS['table'] = 'table';
Expand Down
Expand Up @@ -23,6 +23,7 @@ class TransformationOverviewControllerTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

Expand Down
1 change: 1 addition & 0 deletions test/classes/CoreTest.php
Expand Up @@ -29,6 +29,7 @@ class CoreTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 0;
$GLOBALS['db'] = '';
$GLOBALS['table'] = '';
Expand Down
1 change: 1 addition & 0 deletions test/classes/CreateAddFieldTest.php
Expand Up @@ -22,6 +22,7 @@ class CreateAddFieldTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$this->createAddField = new CreateAddField($GLOBALS['dbi']);
}

Expand Down
1 change: 1 addition & 0 deletions test/classes/Database/Designer/CommonTest.php
Expand Up @@ -24,6 +24,7 @@ class CommonTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 1;
$_SESSION = [
'relation' => [
Expand Down
1 change: 1 addition & 0 deletions test/classes/Database/DesignerTest.php
Expand Up @@ -26,6 +26,7 @@ class DesignerTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 1;
$GLOBALS['cfg']['ServerDefault'] = 1;
$GLOBALS['cfg']['PDFPageSizes'] = [
Expand Down
2 changes: 2 additions & 0 deletions test/classes/Database/EventsTest.php
Expand Up @@ -21,6 +21,7 @@ class EventsTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['server'] = 0;
Expand All @@ -42,6 +43,7 @@ protected function setUp(): void
*/
protected function tearDown(): void
{
parent::tearDown();
if ($GLOBALS['tear_down']['server']) {
unset($GLOBALS['cfg']['ServerDefault']);
}
Expand Down
1 change: 1 addition & 0 deletions test/classes/Database/QbeTest.php
Expand Up @@ -29,6 +29,7 @@ class QbeTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 0;
$GLOBALS['db'] = 'pma_test';
$this->object = new Qbe(new Relation($GLOBALS['dbi']), new Template(), $GLOBALS['dbi'], 'pma_test');
Expand Down
1 change: 1 addition & 0 deletions test/classes/Database/RoutinesTest.php
Expand Up @@ -22,6 +22,7 @@ class RoutinesTest extends AbstractTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['cfg']['Server']['DisableIS'] = false;
Expand Down
2 changes: 2 additions & 0 deletions test/classes/Database/SearchTest.php
Expand Up @@ -28,6 +28,7 @@ class SearchTest extends PmaTestCase
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 0;
$GLOBALS['db'] = 'pma';
$GLOBALS['_POST'] = [];
Expand Down Expand Up @@ -61,6 +62,7 @@ protected function setUp(): void
*/
protected function tearDown(): void
{
parent::tearDown();
unset($this->object);
}

Expand Down

0 comments on commit 6eaa55e

Please sign in to comment.