Merge #15514 - Unit test fixes for phpunit 8 compatibility
Pull-request: #15514 Ref: #15236 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
0eeb98275e
12
.travis.yml
12
.travis.yml
@ -91,6 +91,18 @@ matrix:
|
||||
- php: "5.5"
|
||||
env: CI_MODE=test
|
||||
dist: trusty
|
||||
- php: "7.3"
|
||||
env: CI_MODE=test
|
||||
name: "Run tests using phpunit 8"
|
||||
install:
|
||||
- composer require --no-interaction php>=7.1
|
||||
- composer remove phpunit/phpunit-selenium --dev --no-interaction
|
||||
- composer remove phpunit/phpunit --dev --no-interaction
|
||||
- composer require --dev --no-interaction phpunit/phpunit ^8
|
||||
- rm -rf test/selenium
|
||||
- "find test/ -type f -print0 | xargs -0 sed -i 's/function setUpBeforeClass()/function setUpBeforeClass(): void/g'"
|
||||
- "find test/ -type f -print0 | xargs -0 sed -i 's/function setUp()/function setUp(): void/g'"
|
||||
- "find test/ -type f -print0 | xargs -0 sed -i 's/function tearDown()/function tearDown(): void/g'"
|
||||
- php: "7.1"
|
||||
env: CI_MODE=test DBASE=true
|
||||
install:
|
||||
|
||||
@ -1294,7 +1294,7 @@ class Util
|
||||
// if the unit is not bytes (as represented in current language)
|
||||
// reformat with max length of 5
|
||||
// 4th parameter=true means do not reformat if value < 1
|
||||
$return_value = self::formatNumber($value, 5, $comma, true);
|
||||
$return_value = self::formatNumber($value, 5, $comma, true, false);
|
||||
} else {
|
||||
// do not reformat, just handle the locale
|
||||
$return_value = self::formatNumber($value, 0);
|
||||
|
||||
@ -16,6 +16,7 @@ use PHPUnit\Framework\TestCase;
|
||||
/**
|
||||
* Environment tests
|
||||
*
|
||||
* @group environment
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class Environment_Test extends TestCase
|
||||
|
||||
@ -26,7 +26,7 @@ class AdvisorTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['PMA_Config'] = new Config();
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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');
|
||||
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->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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ class FileTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['charset_conversion'] = false;
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ class HeaderTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
if (!defined('PMA_IS_WINDOWS')) {
|
||||
define('PMA_IS_WINDOWS', false);
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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)));
|
||||
|
||||
@ -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)) {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -23,7 +23,7 @@ class MenuTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
if (!defined('PMA_IS_WINDOWS')) {
|
||||
define('PMA_IS_WINDOWS', false);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeColumnContainerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeColumnTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeDatabaseTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeEventContainerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeEventTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeFunctionContainerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeFunctionTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeIndexContainerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeIndexTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeProcedureContainerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeProcedureTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeTableContainerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeTableTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = 'b_browse';
|
||||
|
||||
@ -25,7 +25,7 @@ class NodeTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeTriggerContainerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeTriggerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeViewContainerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
|
||||
|
||||
@ -23,7 +23,7 @@ class NodeViewTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -34,7 +34,7 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['PMA_Config'] = new Config();
|
||||
$GLOBALS['PMA_Config']->enableBc();
|
||||
|
||||
@ -28,7 +28,7 @@ class ExportCodegenTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$this->object = new ExportCodegen(null);
|
||||
|
||||
@ -28,7 +28,7 @@ class ExportCsvTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$this->object = new ExportCsv();
|
||||
|
||||
@ -27,7 +27,7 @@ class ExportExcelTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$this->object = new ExportExcel();
|
||||
|
||||
@ -28,7 +28,7 @@ class ExportHtmlwordTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$this->object = new ExportHtmlword();
|
||||
|
||||
@ -27,7 +27,7 @@ class ExportJsonTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -27,7 +27,7 @@ class ExportLatexTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -28,7 +28,7 @@ class ExportMediawikiTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -29,7 +29,7 @@ class ExportOdsTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -29,7 +29,7 @@ class ExportOdtTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -28,7 +28,7 @@ class ExportPdfTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -28,7 +28,7 @@ class ExportPhparrayTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -30,7 +30,7 @@ class ExportSqlTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -28,7 +28,7 @@ class ExportTexytextTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -29,7 +29,7 @@ class ExportXmlTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -28,7 +28,7 @@ class ExportYamlTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -24,7 +24,7 @@ class OptionsPropertyMainGroupTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new OptionsPropertyMainGroup();
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class OptionsPropertyRootGroupTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new OptionsPropertyRootGroup();
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class OptionsPropertySubgroupTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new OptionsPropertySubgroup();
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class OptionsPropertyGroupTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\Options\OptionsPropertyGroup');
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class OptionsPropertyItemTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\Options\OptionsPropertyItem');
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class OptionsPropertyOneItemTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\Options\OptionsPropertyOneItem');
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ class ExportPluginPropertiesTest extends ImportPluginPropertiesTest
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new ExportPluginProperties();
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class ImportPluginPropertiesTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new ImportPluginProperties();
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class PluginPropertyItemTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\Plugins\PluginPropertyItem');
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class PropertyItemTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->stub = $this->getMockForAbstractClass('PhpMyAdmin\Properties\PropertyItem');
|
||||
}
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -22,7 +22,7 @@ class IndexTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['cfg']['ProxyUrl'] = '';
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -23,7 +23,7 @@ class ThemeManagerTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['cfg']['ThemePerServer'] = false;
|
||||
$GLOBALS['cfg']['ThemeDefault'] = 'pmahomme';
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -23,7 +23,7 @@ class TransformationsTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -24,7 +24,7 @@ class PMA_DBI_Test extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
function setUp()
|
||||
{
|
||||
$GLOBALS['cfg']['DBG']['sql'] = false;
|
||||
$GLOBALS['cfg']['IconvExtraParams'] = '';
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user