diff options
author | William Desportes <williamdes@wdes.fr> | 2019-10-29 00:28:03 +0300 |
---|---|---|
committer | William Desportes <williamdes@wdes.fr> | 2019-10-29 00:30:40 +0300 |
commit | 0eeb98275e1838976d3652cbbf58b0124dd69189 (patch) | |
tree | 8d69fd663bc37925155c51d15d482d7a3f2599c2 /test | |
parent | e646a9cca92d9df3edfe68389bea0004234176b4 (diff) | |
parent | eb33bbb76fe2b04cf3bc7dbf4691fd91551346c4 (diff) |
Merge #15514 - Unit test fixes for phpunit 8 compatibility
Pull-request: #15514
Ref: #15236
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'test')
69 files changed, 127 insertions, 90 deletions
diff --git a/test/Environment_test.php b/test/Environment_test.php index 127455634a..f761e82c53 100644 --- a/test/Environment_test.php +++ b/test/Environment_test.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\TestCase; /** * Environment tests * + * @group environment * @package PhpMyAdmin-test */ class Environment_Test extends TestCase diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php index 569b639efc..565b55da30 100644 --- a/test/classes/AdvisorTest.php +++ b/test/classes/AdvisorTest.php @@ -26,7 +26,7 @@ class AdvisorTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['server'] = 1; diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index 80baff36e6..f475438578 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -32,7 +32,7 @@ class FormDisplayTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath(); $GLOBALS['PMA_Config'] = new Config(); diff --git a/test/classes/Config/FormTest.php b/test/classes/Config/FormTest.php index e1e6353294..8c3d9e4a71 100644 --- a/test/classes/Config/FormTest.php +++ b/test/classes/Config/FormTest.php @@ -31,7 +31,7 @@ class FormTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath(); $GLOBALS['PMA_Config'] = new Config(); diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index 1ae79ec012..954f21047e 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -11,7 +11,7 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Config; use PhpMyAdmin\Tests\PmaTestCase; use PhpMyAdmin\Theme; -use PHPUnit_Framework_Assert as Assert; +use PHPUnit\Framework\Assert; /** * Tests behaviour of PhpMyAdmin\Config class @@ -936,6 +936,7 @@ class ConfigTest extends PmaTestCase /** * Test for isGitRevision * + * @group git-revision * @return void */ public function testIsGitRevisionLocalGitDir() @@ -996,6 +997,7 @@ class ConfigTest extends PmaTestCase /** * Test for isGitRevision * + * @group git-revision * @return void */ public function testIsGitRevisionExternalGitDir() @@ -1057,6 +1059,7 @@ class ConfigTest extends PmaTestCase /** * Test for checkGitRevision packs folder * + * @group git-revision * @return void */ public function testCheckGitRevisionPacksFolder() @@ -1120,6 +1123,7 @@ class ConfigTest extends PmaTestCase /** * Test for checkGitRevision packs folder * + * @group git-revision * @return void */ public function testCheckGitRevisionRefFile() @@ -1175,6 +1179,7 @@ class ConfigTest extends PmaTestCase /** * Test for checkGitRevision with packs as file * + * @group git-revision * @return void */ public function testCheckGitRevisionPacksFile() @@ -1329,18 +1334,25 @@ class ConfigTest extends PmaTestCase */ public function testCheckServers($settings, $expected, $error = false) { - if ($error) { - $this->setExpectedException('PHPUnit_Framework_Error'); - } - - $this->object->settings['Servers'] = $settings; - $this->object->checkServers(); - if (is_null($expected)) { - $expected = $this->object->default_server; - } else { - $expected = array_merge($this->object->default_server, $expected); + try { + $this->object->settings['Servers'] = $settings; + $this->object->checkServers(); + if (is_null($expected)) { + $expected = $this->object->default_server; + } else { + $expected = array_merge($this->object->default_server, $expected); + } + $this->assertEquals($expected, $this->object->settings['Servers'][1]); + if ($error) { + $this->assertTrue(false); + } + } catch (\Exception $e) { + if ($error) { + $this->assertTrue(true); + } else { + throw $e; + } } - $this->assertEquals($expected, $this->object->settings['Servers'][1]); } /** diff --git a/test/classes/Di/ContainerTest.php b/test/classes/Di/ContainerTest.php index 51a58e92bc..2837cd8259 100644 --- a/test/classes/Di/ContainerTest.php +++ b/test/classes/Di/ContainerTest.php @@ -9,6 +9,7 @@ namespace PhpMyAdmin\Tests\Di; use PhpMyAdmin\Di\Container; use PhpMyAdmin\Tests\PmaTestCase; +use Psr\Container\NotFoundExceptionInterface; /** * Tests for PhpMyAdmin\Di\Container class @@ -64,8 +65,12 @@ class ContainerTest extends PmaTestCase */ public function testGetThrowsNotFoundException() { - $this->setExpectedException('Psr\Container\NotFoundExceptionInterface'); - $this->container->get('name'); + try { + $this->container->get('name'); + $this->assertTrue(false); + } catch (NotFoundExceptionInterface $e) { + $this->assertTrue(true); + } } /** diff --git a/test/classes/ErrorTest.php b/test/classes/ErrorTest.php index e29b261b3e..f4a0188026 100644 --- a/test/classes/ErrorTest.php +++ b/test/classes/ErrorTest.php @@ -119,7 +119,7 @@ class ErrorTest extends PmaTestCase public function testGetBacktraceDisplay() { $this->assertContains( - 'PHPUnit_Framework_TestResult->run(<Class:PhpMyAdmin\Tests\ErrorTest>)<br />', + 'TestResult->run(<Class:PhpMyAdmin\Tests\ErrorTest>)<br />', $this->object->getBacktraceDisplay() ); } diff --git a/test/classes/FileTest.php b/test/classes/FileTest.php index 8aa92154c7..aecbf1b19b 100644 --- a/test/classes/FileTest.php +++ b/test/classes/FileTest.php @@ -22,7 +22,7 @@ class FileTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['charset_conversion'] = false; } diff --git a/test/classes/HeaderTest.php b/test/classes/HeaderTest.php index 98f8e97299..4385b99b04 100644 --- a/test/classes/HeaderTest.php +++ b/test/classes/HeaderTest.php @@ -26,7 +26,7 @@ class HeaderTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { if (!defined('PMA_IS_WINDOWS')) { define('PMA_IS_WINDOWS', false); diff --git a/test/classes/IndexTest.php b/test/classes/IndexTest.php index 3d6dd19094..46566dab4f 100644 --- a/test/classes/IndexTest.php +++ b/test/classes/IndexTest.php @@ -24,7 +24,7 @@ class IndexTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $this->_params['Schema'] = "PMA_Schema"; $this->_params['Table'] = "PMA_Table"; diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 2036628847..f799ffc12b 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -32,7 +32,7 @@ class InsertEditTest extends TestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 1; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; @@ -60,6 +60,7 @@ class InsertEditTest extends TestCase $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'] = ''; $GLOBALS['cfg']['Confirm'] = true; $GLOBALS['cfg']['LoginCookieValidity'] = 1440; + $GLOBALS['cfg']['enable_drag_drop_import'] = true; $GLOBALS['PMA_Config'] = new Config(); $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -2672,7 +2673,7 @@ class InsertEditTest extends TestCase public function testVerifyWhetherValueCanBeTruncatedAndAppendExtraData() { $extra_data = array('isNeedToRecheck' => true); - $meta = new stdClass(); + $_POST['where_clause'][0] = 1; $dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface') @@ -2682,7 +2683,7 @@ class InsertEditTest extends TestCase $dbi->expects($this->at(0)) ->method('tryQuery') ->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1'); - + $meta = new stdClass(); $meta->type = 'int'; $dbi->expects($this->at(1)) ->method('getFieldsMeta') @@ -2699,7 +2700,9 @@ class InsertEditTest extends TestCase ->method('tryQuery') ->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1'); + $meta = new stdClass(); $meta->type = 'int'; + $meta->flags = ''; $dbi->expects($this->at(5)) ->method('getFieldsMeta') ->will($this->returnValue(array($meta))); @@ -2715,7 +2718,9 @@ class InsertEditTest extends TestCase ->method('tryQuery') ->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1'); + $meta = new stdClass(); $meta->type = 'timestamp'; + $meta->flags = ''; $dbi->expects($this->at(9)) ->method('getFieldsMeta') ->will($this->returnValue(array($meta))); diff --git a/test/classes/LanguageTest.php b/test/classes/LanguageTest.php index 36642a8ded..72c9032afc 100644 --- a/test/classes/LanguageTest.php +++ b/test/classes/LanguageTest.php @@ -24,7 +24,7 @@ class LanguageTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $loc = LOCALE_PATH . '/cs/LC_MESSAGES/phpmyadmin.mo'; if (! is_readable($loc)) { diff --git a/test/classes/ListDatabaseTest.php b/test/classes/ListDatabaseTest.php index 51920b595c..06556e13ad 100644 --- a/test/classes/ListDatabaseTest.php +++ b/test/classes/ListDatabaseTest.php @@ -26,7 +26,7 @@ class ListDatabaseTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['cfg']['Server']['only_db'] = array('single\\_db'); $this->object = new ListDatabase(); diff --git a/test/classes/MenuTest.php b/test/classes/MenuTest.php index 6cdee18208..76b6d723de 100644 --- a/test/classes/MenuTest.php +++ b/test/classes/MenuTest.php @@ -23,7 +23,7 @@ class MenuTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { if (!defined('PMA_IS_WINDOWS')) { define('PMA_IS_WINDOWS', false); diff --git a/test/classes/Navigation/NodeFactoryTest.php b/test/classes/Navigation/NodeFactoryTest.php index 6632f318fb..adbfc431ad 100644 --- a/test/classes/Navigation/NodeFactoryTest.php +++ b/test/classes/Navigation/NodeFactoryTest.php @@ -10,7 +10,6 @@ namespace PhpMyAdmin\Tests\Navigation; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\Node; use PhpMyAdmin\Tests\PmaTestCase; -use PhpMyAdmin\Theme; /** * Tests for NodeFactory class @@ -24,7 +23,7 @@ class NodeFactoryTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } @@ -84,8 +83,12 @@ class NodeFactoryTest extends PmaTestCase */ public function testFileError() { - $this->setExpectedException('PHPUnit_Framework_Error'); - NodeFactory::getInstance('NodeDoesNotExist'); + try { + NodeFactory::getInstance('NodeDoesNotExist'); + $this->assertTrue(false); + } catch (\Exception $e) { + $this->assertTrue(true); + } } /** @@ -95,7 +98,11 @@ class NodeFactoryTest extends PmaTestCase */ public function testClassNameError() { - $this->setExpectedException('PHPUnit_Framework_Error'); - NodeFactory::getInstance('Invalid'); + try { + NodeFactory::getInstance('Invalid'); + $this->assertTrue(false); + } catch (\Exception $e) { + $this->assertTrue(true); + } } } diff --git a/test/classes/Navigation/Nodes/NodeColumnContainerTest.php b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php index 94ea54988b..b4ccef8626 100644 --- a/test/classes/Navigation/Nodes/NodeColumnContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php @@ -23,7 +23,7 @@ class NodeColumnContainerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeColumnTest.php b/test/classes/Navigation/Nodes/NodeColumnTest.php index 96eec958ed..d9585e9876 100644 --- a/test/classes/Navigation/Nodes/NodeColumnTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnTest.php @@ -23,7 +23,7 @@ class NodeColumnTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeDatabaseTest.php b/test/classes/Navigation/Nodes/NodeDatabaseTest.php index 6bd2c945c7..0def424ec9 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseTest.php @@ -23,7 +23,7 @@ class NodeDatabaseTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure'; diff --git a/test/classes/Navigation/Nodes/NodeEventContainerTest.php b/test/classes/Navigation/Nodes/NodeEventContainerTest.php index 7651954bba..ef57d2d167 100644 --- a/test/classes/Navigation/Nodes/NodeEventContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeEventContainerTest.php @@ -23,7 +23,7 @@ class NodeEventContainerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeEventTest.php b/test/classes/Navigation/Nodes/NodeEventTest.php index c88962268a..90260b02f1 100644 --- a/test/classes/Navigation/Nodes/NodeEventTest.php +++ b/test/classes/Navigation/Nodes/NodeEventTest.php @@ -23,7 +23,7 @@ class NodeEventTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php index 703902b341..a593ce3a26 100644 --- a/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php @@ -23,7 +23,7 @@ class NodeFunctionContainerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeFunctionTest.php b/test/classes/Navigation/Nodes/NodeFunctionTest.php index 8b8ea4a1f6..e91d303c47 100644 --- a/test/classes/Navigation/Nodes/NodeFunctionTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionTest.php @@ -23,7 +23,7 @@ class NodeFunctionTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeIndexContainerTest.php b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php index c83d131cea..713f16e58d 100644 --- a/test/classes/Navigation/Nodes/NodeIndexContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php @@ -23,7 +23,7 @@ class NodeIndexContainerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeIndexTest.php b/test/classes/Navigation/Nodes/NodeIndexTest.php index 38ee6f6b63..a7c4c844ee 100644 --- a/test/classes/Navigation/Nodes/NodeIndexTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexTest.php @@ -23,7 +23,7 @@ class NodeIndexTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php index 8420053f0e..506b877f86 100644 --- a/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php @@ -23,7 +23,7 @@ class NodeProcedureContainerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeProcedureTest.php b/test/classes/Navigation/Nodes/NodeProcedureTest.php index a964ace9c4..291ec32e71 100644 --- a/test/classes/Navigation/Nodes/NodeProcedureTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureTest.php @@ -23,7 +23,7 @@ class NodeProcedureTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeTableContainerTest.php b/test/classes/Navigation/Nodes/NodeTableContainerTest.php index 41e9edf2d9..a01a44af65 100644 --- a/test/classes/Navigation/Nodes/NodeTableContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTableContainerTest.php @@ -23,7 +23,7 @@ class NodeTableContainerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true; diff --git a/test/classes/Navigation/Nodes/NodeTableTest.php b/test/classes/Navigation/Nodes/NodeTableTest.php index 6e2fd21ceb..6d92c00997 100644 --- a/test/classes/Navigation/Nodes/NodeTableTest.php +++ b/test/classes/Navigation/Nodes/NodeTableTest.php @@ -23,7 +23,7 @@ class NodeTableTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = 'b_browse'; diff --git a/test/classes/Navigation/Nodes/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php index 4ee258b134..fe5b41390c 100644 --- a/test/classes/Navigation/Nodes/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -25,7 +25,7 @@ class NodeTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; $GLOBALS['cfg']['Server']['DisableIS'] = false; diff --git a/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php index 1ef6784e54..8be10e8f43 100644 --- a/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php @@ -23,7 +23,7 @@ class NodeTriggerContainerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeTriggerTest.php b/test/classes/Navigation/Nodes/NodeTriggerTest.php index 68f7f7106e..d7f8d4c181 100644 --- a/test/classes/Navigation/Nodes/NodeTriggerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerTest.php @@ -23,7 +23,7 @@ class NodeTriggerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeViewContainerTest.php b/test/classes/Navigation/Nodes/NodeViewContainerTest.php index f9dbf28754..4015429a71 100644 --- a/test/classes/Navigation/Nodes/NodeViewContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeViewContainerTest.php @@ -23,7 +23,7 @@ class NodeViewContainerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true; diff --git a/test/classes/Navigation/Nodes/NodeViewTest.php b/test/classes/Navigation/Nodes/NodeViewTest.php index f1c50e8452..c9825dc168 100644 --- a/test/classes/Navigation/Nodes/NodeViewTest.php +++ b/test/classes/Navigation/Nodes/NodeViewTest.php @@ -23,7 +23,7 @@ class NodeViewTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['server'] = 0; } diff --git a/test/classes/PdfTest.php b/test/classes/PdfTest.php index 0f8942d220..d083daff07 100644 --- a/test/classes/PdfTest.php +++ b/test/classes/PdfTest.php @@ -23,7 +23,7 @@ class PdfTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index 6aab175b27..576ca7d49a 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -34,7 +34,7 @@ class AuthenticationCookieTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Plugins/Export/ExportCodegenTest.php b/test/classes/Plugins/Export/ExportCodegenTest.php index 58e05153ed..d654fcaa24 100644 --- a/test/classes/Plugins/Export/ExportCodegenTest.php +++ b/test/classes/Plugins/Export/ExportCodegenTest.php @@ -28,7 +28,7 @@ class ExportCodegenTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $this->object = new ExportCodegen(null); diff --git a/test/classes/Plugins/Export/ExportCsvTest.php b/test/classes/Plugins/Export/ExportCsvTest.php index 0e17f1280c..da9544c943 100644 --- a/test/classes/Plugins/Export/ExportCsvTest.php +++ b/test/classes/Plugins/Export/ExportCsvTest.php @@ -28,7 +28,7 @@ class ExportCsvTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $this->object = new ExportCsv(); diff --git a/test/classes/Plugins/Export/ExportExcelTest.php b/test/classes/Plugins/Export/ExportExcelTest.php index 3f771bb177..b554140a76 100644 --- a/test/classes/Plugins/Export/ExportExcelTest.php +++ b/test/classes/Plugins/Export/ExportExcelTest.php @@ -27,7 +27,7 @@ class ExportExcelTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $this->object = new ExportExcel(); diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index afdd40c043..eff74520f7 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -28,7 +28,7 @@ class ExportHtmlwordTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $this->object = new ExportHtmlword(); diff --git a/test/classes/Plugins/Export/ExportJsonTest.php b/test/classes/Plugins/Export/ExportJsonTest.php index e1a13e0237..7e235ce4b8 100644 --- a/test/classes/Plugins/Export/ExportJsonTest.php +++ b/test/classes/Plugins/Export/ExportJsonTest.php @@ -27,7 +27,7 @@ class ExportJsonTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportLatexTest.php b/test/classes/Plugins/Export/ExportLatexTest.php index ba6649fa84..d3b0fa2ffb 100644 --- a/test/classes/Plugins/Export/ExportLatexTest.php +++ b/test/classes/Plugins/Export/ExportLatexTest.php @@ -27,7 +27,7 @@ class ExportLatexTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportMediawikiTest.php b/test/classes/Plugins/Export/ExportMediawikiTest.php index 31f1747acf..f4831d6493 100644 --- a/test/classes/Plugins/Export/ExportMediawikiTest.php +++ b/test/classes/Plugins/Export/ExportMediawikiTest.php @@ -28,7 +28,7 @@ class ExportMediawikiTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportOdsTest.php b/test/classes/Plugins/Export/ExportOdsTest.php index 2b5181eec0..654feabb5f 100644 --- a/test/classes/Plugins/Export/ExportOdsTest.php +++ b/test/classes/Plugins/Export/ExportOdsTest.php @@ -29,7 +29,7 @@ class ExportOdsTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index 7b03738a5b..c165c69805 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -29,7 +29,7 @@ class ExportOdtTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportPdfTest.php b/test/classes/Plugins/Export/ExportPdfTest.php index 0a2e13baeb..00f4c7caaa 100644 --- a/test/classes/Plugins/Export/ExportPdfTest.php +++ b/test/classes/Plugins/Export/ExportPdfTest.php @@ -28,7 +28,7 @@ class ExportPdfTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportPhparrayTest.php b/test/classes/Plugins/Export/ExportPhparrayTest.php index d326d71fee..ca81bafa5e 100644 --- a/test/classes/Plugins/Export/ExportPhparrayTest.php +++ b/test/classes/Plugins/Export/ExportPhparrayTest.php @@ -28,7 +28,7 @@ class ExportPhparrayTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 937fa0b086..635055050c 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -30,7 +30,7 @@ class ExportSqlTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['db'] = 'db'; diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php index d6a9bb7d67..2648c7cf95 100644 --- a/test/classes/Plugins/Export/ExportTexytextTest.php +++ b/test/classes/Plugins/Export/ExportTexytextTest.php @@ -28,7 +28,7 @@ class ExportTexytextTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportXmlTest.php b/test/classes/Plugins/Export/ExportXmlTest.php index 45f783eb64..cff3b337b4 100644 --- a/test/classes/Plugins/Export/ExportXmlTest.php +++ b/test/classes/Plugins/Export/ExportXmlTest.php @@ -29,7 +29,7 @@ class ExportXmlTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportYamlTest.php b/test/classes/Plugins/Export/ExportYamlTest.php index 3c70d2189c..e5b613f398 100644 --- a/test/classes/Plugins/Export/ExportYamlTest.php +++ b/test/classes/Plugins/Export/ExportYamlTest.php @@ -28,7 +28,7 @@ class ExportYamlTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/Helpers/TablePropertyTest.php b/test/classes/Plugins/Export/Helpers/TablePropertyTest.php index c8c53e51e5..76ebe5b121 100644 --- a/test/classes/Plugins/Export/Helpers/TablePropertyTest.php +++ b/test/classes/Plugins/Export/Helpers/TablePropertyTest.php @@ -24,7 +24,7 @@ class TablePropertyTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['server'] = 0; $row = array(' name ', 'int ', true, ' PRI', '0', 'mysql'); diff --git a/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php index e1f6e01433..5213133bfe 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php @@ -24,7 +24,7 @@ class OptionsPropertyMainGroupTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->object = new OptionsPropertyMainGroup(); } diff --git a/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php index b6f85e2b79..a265d2b493 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php @@ -24,7 +24,7 @@ class OptionsPropertyRootGroupTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->object = new OptionsPropertyRootGroup(); } diff --git a/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php index 7e86a63c2b..58429384aa 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php @@ -24,7 +24,7 @@ class OptionsPropertySubgroupTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->object = new OptionsPropertySubgroup(); } diff --git a/test/classes/Properties/Options/OptionsPropertyGroupTest.php b/test/classes/Properties/Options/OptionsPropertyGroupTest.php index 2f7adb1c68..75c3484d7a 100644 --- a/test/classes/Properties/Options/OptionsPropertyGroupTest.php +++ b/test/classes/Properties/Options/OptionsPropertyGroupTest.php @@ -24,7 +24,7 @@ class OptionsPropertyGroupTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\Options\OptionsPropertyGroup'); } diff --git a/test/classes/Properties/Options/OptionsPropertyItemTest.php b/test/classes/Properties/Options/OptionsPropertyItemTest.php index 265a2308fa..e11d0175a4 100644 --- a/test/classes/Properties/Options/OptionsPropertyItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyItemTest.php @@ -23,7 +23,7 @@ class OptionsPropertyItemTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\Options\OptionsPropertyItem'); } diff --git a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php index 1dc8d000e5..56e198d0e7 100644 --- a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php @@ -23,7 +23,7 @@ class OptionsPropertyOneItemTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\Options\OptionsPropertyOneItem'); } diff --git a/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php b/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php index d3a1610b61..774d84cfd7 100644 --- a/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php +++ b/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php @@ -25,7 +25,7 @@ class ExportPluginPropertiesTest extends ImportPluginPropertiesTest * * @return void */ - protected function setup() + protected function setUp() { $this->object = new ExportPluginProperties(); } diff --git a/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php b/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php index 934721880f..dd3aa2f6f3 100644 --- a/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php +++ b/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php @@ -24,7 +24,7 @@ class ImportPluginPropertiesTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->object = new ImportPluginProperties(); } diff --git a/test/classes/Properties/Plugins/PluginPropertyItemTest.php b/test/classes/Properties/Plugins/PluginPropertyItemTest.php index 8a27540024..b46018cdf5 100644 --- a/test/classes/Properties/Plugins/PluginPropertyItemTest.php +++ b/test/classes/Properties/Plugins/PluginPropertyItemTest.php @@ -23,7 +23,7 @@ class PluginPropertyItemTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\Plugins\PluginPropertyItem'); } diff --git a/test/classes/Properties/PropertyItemTest.php b/test/classes/Properties/PropertyItemTest.php index 564506f41e..29797ece50 100644 --- a/test/classes/Properties/PropertyItemTest.php +++ b/test/classes/Properties/PropertyItemTest.php @@ -23,7 +23,7 @@ class PropertyItemTest extends TestCase * * @return void */ - protected function setup() + protected function setUp() { $this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\PropertyItem'); } diff --git a/test/classes/Server/Status/DataTest.php b/test/classes/Server/Status/DataTest.php index 2ecb9291ae..512a66a0a2 100644 --- a/test/classes/Server/Status/DataTest.php +++ b/test/classes/Server/Status/DataTest.php @@ -29,7 +29,7 @@ class DataTest extends PmaTestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['PMA_PHP_SELF'] = Core::getenv('PHP_SELF'); $GLOBALS['cfg']['Server']['host'] = "::1"; diff --git a/test/classes/Setup/IndexTest.php b/test/classes/Setup/IndexTest.php index bca6a1028f..8b09052f89 100644 --- a/test/classes/Setup/IndexTest.php +++ b/test/classes/Setup/IndexTest.php @@ -22,7 +22,7 @@ class IndexTest extends TestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['cfg']['ProxyUrl'] = ''; } diff --git a/test/classes/TemplateTest.php b/test/classes/TemplateTest.php index 2e3926a786..7087c030c7 100644 --- a/test/classes/TemplateTest.php +++ b/test/classes/TemplateTest.php @@ -9,6 +9,7 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\PmaTestCase; +use Twig\Error\LoaderError; /** * Test for PhpMyAdmin\Template class @@ -89,8 +90,12 @@ class TemplateTest extends PmaTestCase */ public function testRenderTemplateNotFound() { - $this->setExpectedException('Twig\Error\LoaderError'); - Template::get('template not found')->render(); + try { + Template::get('template not found')->render(); + $this->assertTrue(false); + } catch (LoaderError $e) { + $this->assertTrue(true); + } } /** diff --git a/test/classes/ThemeManagerTest.php b/test/classes/ThemeManagerTest.php index 33fd46756f..e41bf58fbf 100644 --- a/test/classes/ThemeManagerTest.php +++ b/test/classes/ThemeManagerTest.php @@ -23,7 +23,7 @@ class ThemeManagerTest extends PmaTestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['cfg']['ThemePerServer'] = false; $GLOBALS['cfg']['ThemeDefault'] = 'pmahomme'; diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index f46fc8f55f..a3ce462641 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -11,7 +11,7 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\PmaTestCase; use PhpMyAdmin\Tracker; use PhpMyAdmin\Util; -use PHPUnit_Framework_Assert as Assert; +use PHPUnit\Framework\Assert; use ReflectionClass; /** diff --git a/test/classes/TransformationsTest.php b/test/classes/TransformationsTest.php index 30e269c490..a3d0515929 100644 --- a/test/classes/TransformationsTest.php +++ b/test/classes/TransformationsTest.php @@ -23,7 +23,7 @@ class TransformationsTest extends TestCase * * @return void */ - public function setup() + public function setUp() { $GLOBALS['table'] = 'table'; $GLOBALS['db'] = 'db'; diff --git a/test/libraries/database_interface_test.php b/test/libraries/database_interface_test.php index e247bf3e6d..b158a7729b 100644 --- a/test/libraries/database_interface_test.php +++ b/test/libraries/database_interface_test.php @@ -24,7 +24,7 @@ class PMA_DBI_Test extends TestCase * * @return void */ - function setup() + function setUp() { $GLOBALS['cfg']['DBG']['sql'] = false; $GLOBALS['cfg']['IconvExtraParams'] = ''; diff --git a/test/selenium/ChangePasswordTest.php b/test/selenium/ChangePasswordTest.php index 3488d7dabd..e3749853a9 100644 --- a/test/selenium/ChangePasswordTest.php +++ b/test/selenium/ChangePasswordTest.php @@ -9,6 +9,8 @@ namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\AssertionFailedError; + /** * PrivilegesTest class * @@ -38,19 +40,19 @@ class ChangePasswordTest extends TestBase try { $ele = $this->waitForElement("byName", "pma_pw"); $this->assertEquals("", $ele->value()); - } catch (\PHPUnit_Framework_AssertionFailedError $e) { + } catch (AssertionFailedError $e) { array_push($this->verificationErrors, $e->toString()); } try { $ele = $this->waitForElement("byName", "pma_pw2"); $this->assertEquals("", $ele->value()); - } catch (\PHPUnit_Framework_AssertionFailedError $e) { + } catch (AssertionFailedError $e) { array_push($this->verificationErrors, $e->toString()); } try { $ele = $this->waitForElement("byName", "generated_pw"); $this->assertEquals("", $ele->value()); - } catch (\PHPUnit_Framework_AssertionFailedError $e) { + } catch (AssertionFailedError $e) { array_push($this->verificationErrors, $e->toString()); } $this->byId("button_generate_password")->click(); |