Merge pull request #17637 from MauricioFauth/dbi-test
Push `dbi` and `dummyDbi` members down
This commit is contained in:
commit
615782a727
@ -44,20 +44,6 @@ abstract class AbstractTestCase extends TestCase
|
||||
'__PHPUNIT_BOOTSTRAP',
|
||||
];
|
||||
|
||||
/**
|
||||
* The DatabaseInterface loaded by setGlobalDbi
|
||||
*
|
||||
* @var DatabaseInterface
|
||||
*/
|
||||
protected $dbi;
|
||||
|
||||
/**
|
||||
* The DbiDummy loaded by setGlobalDbi
|
||||
*
|
||||
* @var DbiDummy
|
||||
*/
|
||||
protected $dummyDbi;
|
||||
|
||||
/**
|
||||
* Prepares environment for the test.
|
||||
* Clean all variables
|
||||
@ -97,7 +83,7 @@ abstract class AbstractTestCase extends TestCase
|
||||
// Config before DBI
|
||||
$this->setGlobalConfig();
|
||||
$this->loadContainerBuilder();
|
||||
$this->setGlobalDbi();
|
||||
$GLOBALS['dbi'] = $this->createDatabaseInterface();
|
||||
$this->setTheme();
|
||||
Cache::purge();
|
||||
}
|
||||
@ -160,13 +146,6 @@ abstract class AbstractTestCase extends TestCase
|
||||
$this->assertTrue($response->hasSuccessState(), 'expected the request not to fail');
|
||||
}
|
||||
|
||||
protected function setGlobalDbi(): void
|
||||
{
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
protected function createDatabaseInterface(?DbiExtension $extension = null): DatabaseInterface
|
||||
{
|
||||
return new DatabaseInterface($extension ?? $this->createDbiDummy());
|
||||
|
||||
@ -6,14 +6,22 @@ namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\Bookmark;
|
||||
use PhpMyAdmin\ConfigStorage\Features\BookmarkFeature;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Dbal\DatabaseName;
|
||||
use PhpMyAdmin\Dbal\TableName;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Bookmark
|
||||
*/
|
||||
class BookmarkTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
@ -21,6 +29,9 @@ class BookmarkTest extends AbstractTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['cfg']['Server']['user'] = 'root';
|
||||
$GLOBALS['cfg']['Server']['pmadb'] = 'phpmyadmin';
|
||||
$GLOBALS['cfg']['Server']['bookmarktable'] = 'pma_bookmark';
|
||||
|
||||
@ -6,9 +6,11 @@ namespace PhpMyAdmin\Tests\Controllers;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Controllers\CheckRelationsController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -16,6 +18,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class CheckRelationsControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testCheckRelationsController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,18 +5,28 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Database\MultiTableQuery;
|
||||
|
||||
use PhpMyAdmin\Controllers\Database\MultiTableQuery\TablesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Controllers\Database\MultiTableQuery\TablesController
|
||||
*/
|
||||
class TablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setLanguage();
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
parent::loadContainerBuilder();
|
||||
parent::loadDbiIntoContainerBuilder();
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,9 +5,11 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Database;
|
||||
|
||||
use PhpMyAdmin\Controllers\Database\PrivilegesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Privileges;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Url;
|
||||
|
||||
@ -19,14 +21,20 @@ use function _pgettext;
|
||||
*/
|
||||
class PrivilegesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/**
|
||||
* Configures global environment.
|
||||
*/
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setLanguage();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testIndex(): void
|
||||
|
||||
@ -6,9 +6,11 @@ namespace PhpMyAdmin\Tests\Controllers\Database\Structure;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Controllers\Database\Structure\FavoriteTableController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\RecentFavoriteTable;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub;
|
||||
use ReflectionClass;
|
||||
|
||||
@ -19,6 +21,20 @@ use function json_encode;
|
||||
*/
|
||||
class FavoriteTableControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testSynchronizeFavoriteTables(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,8 +5,10 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Database\Structure;
|
||||
|
||||
use PhpMyAdmin\Controllers\Database\Structure\RealRowCountController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub;
|
||||
|
||||
use function json_encode;
|
||||
@ -16,6 +18,20 @@ use function json_encode;
|
||||
*/
|
||||
class RealRowCountControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testRealRowCount(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,11 +5,13 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Export;
|
||||
|
||||
use PhpMyAdmin\Controllers\Export\ExportController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Export;
|
||||
use PhpMyAdmin\FieldMetadata;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
use function htmlspecialchars;
|
||||
@ -25,6 +27,20 @@ use const MYSQLI_TYPE_STRING;
|
||||
*/
|
||||
class ExportControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testExportController(): void
|
||||
{
|
||||
parent::loadDbiIntoContainerBuilder();
|
||||
|
||||
@ -7,11 +7,13 @@ namespace PhpMyAdmin\Tests\Controllers\Export\Template;
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\ConfigStorage\RelationParameters;
|
||||
use PhpMyAdmin\Controllers\Export\Template\CreateController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Export\Template as ExportTemplate;
|
||||
use PhpMyAdmin\Export\TemplateModel;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -19,6 +21,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class CreateControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testCreate(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -6,10 +6,12 @@ namespace PhpMyAdmin\Tests\Controllers\Export\Template;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Controllers\Export\Template\DeleteController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Export\TemplateModel;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -17,6 +19,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class DeleteControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testDelete(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -7,10 +7,12 @@ namespace PhpMyAdmin\Tests\Controllers\Export\Template;
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\ConfigStorage\RelationParameters;
|
||||
use PhpMyAdmin\Controllers\Export\Template\LoadController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Export\TemplateModel;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -18,6 +20,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class LoadControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testLoad(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -6,10 +6,12 @@ namespace PhpMyAdmin\Tests\Controllers\Export\Template;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Controllers\Export\Template\UpdateController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Export\TemplateModel;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -17,6 +19,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class UpdateControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testUpdate(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,13 +5,29 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Import;
|
||||
|
||||
use PhpMyAdmin\Controllers\Import\ImportController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Controllers\Import\ImportController
|
||||
*/
|
||||
class ImportControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testIndexParametrized(): void
|
||||
{
|
||||
parent::loadContainerBuilder();
|
||||
|
||||
@ -5,7 +5,9 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers;
|
||||
|
||||
use PhpMyAdmin\Controllers\NavigationController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
@ -14,6 +16,20 @@ use function sprintf;
|
||||
*/
|
||||
class NavigationControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testIndex(): void
|
||||
{
|
||||
parent::loadContainerBuilder();
|
||||
|
||||
@ -5,7 +5,9 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers;
|
||||
|
||||
use PhpMyAdmin\Controllers\NormalizationController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
@ -14,12 +16,20 @@ use function json_encode;
|
||||
*/
|
||||
class NormalizationControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setLanguage();
|
||||
parent::setTheme();
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
parent::loadContainerBuilder();
|
||||
parent::loadDbiIntoContainerBuilder();
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,8 +5,10 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\BinlogController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Url;
|
||||
use PhpMyAdmin\Utils\SessionCache;
|
||||
@ -16,15 +18,21 @@ use PhpMyAdmin\Utils\SessionCache;
|
||||
*/
|
||||
class BinlogControllerTest extends AbstractTestCase
|
||||
{
|
||||
/**
|
||||
* Prepares environment for the test.
|
||||
*/
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['cfg']['MaxRows'] = 10;
|
||||
$GLOBALS['cfg']['ServerDefault'] = 'server';
|
||||
|
||||
@ -5,8 +5,10 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\CollationsController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -14,6 +16,12 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class CollationsControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/**
|
||||
* Prepares environment for the test.
|
||||
*/
|
||||
@ -23,6 +31,9 @@ class CollationsControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,8 +5,10 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Databases;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Databases\CreateController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
use function __;
|
||||
@ -17,6 +19,20 @@ use function sprintf;
|
||||
*/
|
||||
final class CreateControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testCreateDatabase(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -7,8 +7,10 @@ namespace PhpMyAdmin\Tests\Controllers\Server;
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\ConfigStorage\RelationCleanup;
|
||||
use PhpMyAdmin\Controllers\Server\DatabasesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use stdClass;
|
||||
@ -20,11 +22,20 @@ use function __;
|
||||
*/
|
||||
class DatabasesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'pma_test';
|
||||
|
||||
@ -5,8 +5,10 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\EnginesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -14,6 +16,12 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class EnginesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/**
|
||||
* Prepares environment for the test.
|
||||
*/
|
||||
@ -23,6 +31,9 @@ class EnginesControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -9,6 +9,7 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Plugins;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
@ -17,6 +18,12 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class PluginsControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/**
|
||||
* Prepares environment for the test.
|
||||
*/
|
||||
@ -26,6 +33,9 @@ class PluginsControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -6,9 +6,11 @@ namespace PhpMyAdmin\Tests\Controllers\Server;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Controllers\Server\PrivilegesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -16,6 +18,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class PrivilegesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testPrivilegesController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,11 +5,13 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\ShowEngineController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Html\MySQLDocumentation;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\StorageEngine;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
use function __;
|
||||
@ -20,13 +22,25 @@ use function htmlspecialchars;
|
||||
*/
|
||||
class ShowEngineControllerTest extends AbstractTestCase
|
||||
{
|
||||
public function testShowEngine(): void
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testShowEngine(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
|
||||
@ -5,10 +5,12 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Status\Monitor;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\Monitor\GeneralLogController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Server\Status\Monitor;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -16,6 +18,12 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class GeneralLogControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Data */
|
||||
private $data;
|
||||
|
||||
@ -25,6 +33,9 @@ class GeneralLogControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,10 +5,12 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Status\Monitor;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\Monitor\LogVarsController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Server\Status\Monitor;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -16,6 +18,12 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class LogVarsControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Data */
|
||||
private $data;
|
||||
|
||||
@ -25,6 +33,9 @@ class LogVarsControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,10 +5,12 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Status\Monitor;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\Monitor\SlowLogController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Server\Status\Monitor;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -16,6 +18,12 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class SlowLogControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Data */
|
||||
private $data;
|
||||
|
||||
@ -25,6 +33,9 @@ class SlowLogControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,9 +5,11 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Status;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\MonitorController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
use function __;
|
||||
@ -17,6 +19,12 @@ use function __;
|
||||
*/
|
||||
class MonitorControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Data */
|
||||
private $data;
|
||||
|
||||
@ -26,6 +34,9 @@ class MonitorControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,10 +5,12 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Status;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\ProcessesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Server\Status\Processes;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -16,6 +18,12 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class ProcessesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Data */
|
||||
private $data;
|
||||
|
||||
@ -25,6 +33,9 @@ class ProcessesControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,9 +5,11 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Status;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\QueriesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Util;
|
||||
|
||||
@ -20,6 +22,12 @@ use function htmlspecialchars;
|
||||
*/
|
||||
class QueriesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Data */
|
||||
private $data;
|
||||
|
||||
@ -29,6 +37,9 @@ class QueriesControllerTest extends AbstractTestCase
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,11 +5,13 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Status;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\StatusController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Replication;
|
||||
use PhpMyAdmin\ReplicationGui;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -17,12 +19,21 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class StatusControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,9 +5,11 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Server\Status;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\VariablesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -15,6 +17,12 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class VariablesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Data */
|
||||
private $data;
|
||||
|
||||
@ -23,6 +31,9 @@ class VariablesControllerTest extends AbstractTestCase
|
||||
parent::setUp();
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,17 +5,27 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Sql;
|
||||
|
||||
use PhpMyAdmin\Controllers\Sql\EnumValuesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Controllers\Sql\EnumValuesController
|
||||
*/
|
||||
class EnumValuesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
parent::loadContainerBuilder();
|
||||
parent::loadDbiIntoContainerBuilder();
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -5,17 +5,27 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Sql;
|
||||
|
||||
use PhpMyAdmin\Controllers\Sql\SetValuesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Controllers\Sql\SetValuesController
|
||||
*/
|
||||
class SetValuesControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
parent::loadContainerBuilder();
|
||||
parent::loadDbiIntoContainerBuilder();
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -6,15 +6,31 @@ namespace PhpMyAdmin\Tests\Controllers\Table;
|
||||
|
||||
use PhpMyAdmin\Charsets;
|
||||
use PhpMyAdmin\Controllers\Table\OperationsController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\StorageEngine;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Controllers\Table\OperationsController
|
||||
*/
|
||||
class OperationsControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testOperationsController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -6,9 +6,11 @@ namespace PhpMyAdmin\Tests\Controllers\Table;
|
||||
|
||||
use PhpMyAdmin\Controllers\Sql\SqlController;
|
||||
use PhpMyAdmin\Controllers\Table\RecentFavoriteController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\RecentFavoriteTable;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
@ -19,6 +21,20 @@ use Psr\Container\ContainerInterface;
|
||||
*/
|
||||
class RecentFavoriteControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testRecentFavoriteControllerWithValidDbAndTable(): void
|
||||
{
|
||||
$GLOBALS['server'] = 2;
|
||||
|
||||
@ -11,6 +11,7 @@ use PhpMyAdmin\ConfigStorage\RelationParameters;
|
||||
use PhpMyAdmin\Controllers\Sql\SqlController;
|
||||
use PhpMyAdmin\Controllers\Table\ChangeController;
|
||||
use PhpMyAdmin\Controllers\Table\ReplaceController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\FileListing;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\InsertEdit;
|
||||
@ -18,6 +19,7 @@ use PhpMyAdmin\Operations;
|
||||
use PhpMyAdmin\Sql;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use Psr\Container\ContainerInterface;
|
||||
@ -27,9 +29,18 @@ use Psr\Container\ContainerInterface;
|
||||
*/
|
||||
class ReplaceControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['showtable'] = null;
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
|
||||
@ -12,6 +12,7 @@ use PhpMyAdmin\FieldMetadata;
|
||||
use PhpMyAdmin\Table\Search;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub;
|
||||
use PhpMyAdmin\Types;
|
||||
|
||||
@ -24,6 +25,12 @@ use const MYSQLI_TYPE_LONG;
|
||||
*/
|
||||
class SearchControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var ResponseStub */
|
||||
private $response;
|
||||
|
||||
@ -37,6 +44,9 @@ class SearchControllerTest extends AbstractTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
/**
|
||||
* SET these to avoid undefined index error
|
||||
@ -125,7 +135,9 @@ class SearchControllerTest extends AbstractTestCase
|
||||
*/
|
||||
public function testGetDataRowAction(): void
|
||||
{
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
parent::loadDbiIntoContainerBuilder();
|
||||
parent::loadResponseIntoContainerBuilder();
|
||||
|
||||
|
||||
@ -6,10 +6,12 @@ namespace PhpMyAdmin\Tests\Controllers\Table;
|
||||
|
||||
use PhpMyAdmin\Config\PageSettings;
|
||||
use PhpMyAdmin\Controllers\Table\SqlController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Html\MySQLDocumentation;
|
||||
use PhpMyAdmin\SqlQueryForm;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -18,6 +20,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class SqlControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testSqlController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 2;
|
||||
|
||||
@ -6,9 +6,11 @@ namespace PhpMyAdmin\Tests\Controllers\Table\Structure;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Controllers\Table\Structure\ChangeController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Table\ColumnsDefinition;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use ReflectionClass;
|
||||
@ -18,6 +20,20 @@ use ReflectionClass;
|
||||
*/
|
||||
class ChangeControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testChangeController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -9,11 +9,13 @@ use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\ConfigStorage\RelationCleanup;
|
||||
use PhpMyAdmin\Controllers\Table\StructureController;
|
||||
use PhpMyAdmin\CreateAddField;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\FlashMessages;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Index;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PhpMyAdmin\Util;
|
||||
@ -23,6 +25,20 @@ use PhpMyAdmin\Util;
|
||||
*/
|
||||
class StructureControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testStructureController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 2;
|
||||
|
||||
@ -6,9 +6,11 @@ namespace PhpMyAdmin\Tests\Controllers\Table;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Controllers\Table\TrackingController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\SqlQueryForm;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
use PhpMyAdmin\Tracking;
|
||||
|
||||
@ -17,6 +19,20 @@ use PhpMyAdmin\Tracking;
|
||||
*/
|
||||
class TrackingControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testTrackingController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 2;
|
||||
|
||||
@ -5,8 +5,10 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Controllers\Table;
|
||||
|
||||
use PhpMyAdmin\Controllers\Table\TriggersController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -14,6 +16,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class TriggersControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testTriggersController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 2;
|
||||
|
||||
@ -6,9 +6,11 @@ namespace PhpMyAdmin\Tests\Controllers\Table;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\Controllers\Table\ZoomSearchController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Table\Search;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
|
||||
/**
|
||||
@ -16,6 +18,20 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
|
||||
*/
|
||||
class ZoomSearchControllerTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testZoomSearchController(): void
|
||||
{
|
||||
$GLOBALS['server'] = 2;
|
||||
|
||||
@ -9,6 +9,7 @@ use PhpMyAdmin\ConfigStorage\RelationParameters;
|
||||
use PhpMyAdmin\Database\Designer\Common;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Version;
|
||||
|
||||
@ -19,6 +20,12 @@ use function sprintf;
|
||||
*/
|
||||
class CommonTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Common */
|
||||
private $designerCommon;
|
||||
|
||||
@ -28,6 +35,9 @@ class CommonTest extends AbstractTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 1;
|
||||
$_SESSION = [
|
||||
'relation' => [
|
||||
@ -359,7 +369,9 @@ class CommonTest extends AbstractTestCase
|
||||
'relation' => 'rel db',
|
||||
])->toArray();
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$this->loadTestDataForRelationDeleteAddTests(
|
||||
'CREATE TABLE `table\'2` (`field\'1` int(11) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1'
|
||||
);
|
||||
@ -383,7 +395,9 @@ class CommonTest extends AbstractTestCase
|
||||
'relation' => 'rel db',
|
||||
])->toArray();
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$this->loadTestDataForRelationDeleteAddTests(
|
||||
'CREATE TABLE `table\'2` (`field\'1` int(11) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1'
|
||||
@ -426,7 +440,9 @@ class CommonTest extends AbstractTestCase
|
||||
'relation' => 'rel db',
|
||||
])->toArray();
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$this->loadTestDataForRelationDeleteAddTests(
|
||||
'CREATE TABLE `table\'2` ('
|
||||
@ -489,7 +505,9 @@ class CommonTest extends AbstractTestCase
|
||||
'relation' => 'rel db',
|
||||
])->toArray();
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$this->loadTestDataForRelationDeleteAddTests(
|
||||
'CREATE TABLE `table\'2` (`field\'1` int(11) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1'
|
||||
|
||||
@ -4,8 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests\Dbal;
|
||||
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Query\Utilities;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
|
||||
/**
|
||||
@ -13,12 +15,21 @@ use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
*/
|
||||
class DbiDummyTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/**
|
||||
* Configures test parameters.
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['cfg']['DBG']['sql'] = false;
|
||||
$GLOBALS['cfg']['IconvExtraParams'] = '';
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -19,6 +19,7 @@ use PhpMyAdmin\SqlParser\Utils\Query;
|
||||
use PhpMyAdmin\StatementInfo;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use stdClass;
|
||||
|
||||
@ -44,6 +45,12 @@ use const MYSQLI_TYPE_TIMESTAMP;
|
||||
*/
|
||||
class ResultsTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var DisplayResults */
|
||||
protected $object;
|
||||
|
||||
@ -56,6 +63,9 @@ class ResultsTest extends AbstractTestCase
|
||||
parent::setUp();
|
||||
parent::setLanguage();
|
||||
parent::setGlobalConfig();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$this->setTheme();
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
@ -5,9 +5,11 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Error;
|
||||
use PhpMyAdmin\ErrorReport;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Utils\HttpRequest;
|
||||
use PhpMyAdmin\Version;
|
||||
|
||||
@ -24,12 +26,21 @@ use const JSON_UNESCAPED_SLASHES;
|
||||
*/
|
||||
class ErrorReportTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var ErrorReport $errorReport */
|
||||
private $errorReport;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['cfg']['ServerDefault'] = 1;
|
||||
$GLOBALS['cfg']['ProxyUrl'] = '';
|
||||
|
||||
@ -5,10 +5,12 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests\Import;
|
||||
|
||||
use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Html\Generator;
|
||||
use PhpMyAdmin\Import\SimulateDml;
|
||||
use PhpMyAdmin\SqlParser\Parser;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Url;
|
||||
|
||||
/**
|
||||
@ -16,6 +18,20 @@ use PhpMyAdmin\Url;
|
||||
*/
|
||||
class SimulateDmlTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerForTestGetMatchedRows
|
||||
*/
|
||||
|
||||
@ -14,6 +14,7 @@ use PhpMyAdmin\InsertEdit;
|
||||
use PhpMyAdmin\ResponseRenderer;
|
||||
use PhpMyAdmin\Table;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PhpMyAdmin\Url;
|
||||
@ -37,6 +38,12 @@ use const MYSQLI_TYPE_TINY;
|
||||
*/
|
||||
class InsertEditTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var InsertEdit */
|
||||
private $insertEdit;
|
||||
|
||||
@ -49,6 +56,9 @@ class InsertEditTest extends AbstractTestCase
|
||||
parent::setLanguage();
|
||||
parent::setGlobalConfig();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
$GLOBALS['cfg']['ServerDefault'] = 1;
|
||||
|
||||
@ -5,13 +5,21 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Menu;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
/**
|
||||
* @covers \PhpMyAdmin\Menu
|
||||
*/
|
||||
class MenuTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/**
|
||||
* Configures global environment.
|
||||
*/
|
||||
@ -19,6 +27,9 @@ class MenuTest extends AbstractTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
$GLOBALS['server'] = 0;
|
||||
|
||||
@ -9,6 +9,7 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Message;
|
||||
use PhpMyAdmin\Normalization;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PhpMyAdmin\Types;
|
||||
use PhpMyAdmin\Url;
|
||||
@ -23,6 +24,12 @@ use function json_encode;
|
||||
*/
|
||||
class NormalizationTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Normalization */
|
||||
private $normalization;
|
||||
|
||||
@ -32,6 +39,9 @@ class NormalizationTest extends AbstractTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['cfg']['LimitChars'] = 50;
|
||||
$GLOBALS['cfg']['ServerDefault'] = 'PMA_server';
|
||||
$GLOBALS['cfg']['ShowHint'] = true;
|
||||
|
||||
@ -5,7 +5,9 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Operations;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
use function array_merge;
|
||||
|
||||
@ -14,12 +16,21 @@ use function array_merge;
|
||||
*/
|
||||
class OperationsTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Operations */
|
||||
private $object;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem;
|
||||
use PhpMyAdmin\Properties\Options\Items\TextPropertyItem;
|
||||
use PhpMyAdmin\Properties\Plugins\ExportPluginProperties;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use ReflectionMethod;
|
||||
@ -32,6 +33,12 @@ use function ob_start;
|
||||
*/
|
||||
class ExportHtmlwordTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var ExportHtmlword */
|
||||
protected $object;
|
||||
|
||||
@ -41,6 +48,9 @@ class ExportHtmlwordTest extends AbstractTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 0;
|
||||
$this->object = new ExportHtmlword(
|
||||
new Relation($GLOBALS['dbi']),
|
||||
|
||||
@ -17,6 +17,7 @@ use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem;
|
||||
use PhpMyAdmin\Properties\Options\Items\TextPropertyItem;
|
||||
use PhpMyAdmin\Properties\Plugins\ExportPluginProperties;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Tests\Stubs\DummyResult;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use ReflectionMethod;
|
||||
@ -38,6 +39,12 @@ use const MYSQLI_TYPE_STRING;
|
||||
*/
|
||||
class ExportOdtTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var ExportOdt */
|
||||
protected $object;
|
||||
|
||||
@ -47,6 +54,9 @@ class ExportOdtTest extends AbstractTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
$GLOBALS['output_charset_conversion'] = false;
|
||||
|
||||
@ -16,6 +16,7 @@ use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem;
|
||||
use PhpMyAdmin\Properties\Options\Items\TextPropertyItem;
|
||||
use PhpMyAdmin\Properties\Plugins\ExportPluginProperties;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use ReflectionMethod;
|
||||
use ReflectionProperty;
|
||||
@ -30,6 +31,12 @@ use function ob_start;
|
||||
*/
|
||||
class ExportTexytextTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var ExportTexytext */
|
||||
protected $object;
|
||||
|
||||
@ -39,6 +46,9 @@ class ExportTexytextTest extends AbstractTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
$GLOBALS['buffer_needed'] = false;
|
||||
|
||||
@ -8,6 +8,7 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\File;
|
||||
use PhpMyAdmin\Plugins\Import\ImportCsv;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
use function __;
|
||||
use function basename;
|
||||
@ -17,6 +18,12 @@ use function basename;
|
||||
*/
|
||||
class ImportCsvTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var ImportCsv */
|
||||
protected $object;
|
||||
|
||||
@ -27,6 +34,9 @@ class ImportCsvTest extends AbstractTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['plugin_param'] = 'csv';
|
||||
$GLOBALS['errorUrl'] = 'index.php?route=/';
|
||||
@ -238,7 +248,9 @@ class ImportCsvTest extends AbstractTestCase
|
||||
$GLOBALS['csv_terminated'] = ',';
|
||||
$GLOBALS['import_text'] = '"Row 1","Row 2"' . "\n" . '"123","456"';
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$this->dummyDbi->addResult(
|
||||
'SHOW DATABASES',
|
||||
@ -282,7 +294,9 @@ class ImportCsvTest extends AbstractTestCase
|
||||
|
||||
$_REQUEST['csv_col_names'] = 'something';
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$this->dummyDbi->addResult(
|
||||
'SHOW DATABASES',
|
||||
|
||||
@ -4,9 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests\Plugins\Import;
|
||||
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\File;
|
||||
use PhpMyAdmin\Plugins\Import\ImportOds;
|
||||
use PhpMyAdmin\Tests\AbstractTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
|
||||
use function __;
|
||||
use function str_repeat;
|
||||
@ -17,6 +19,12 @@ use function str_repeat;
|
||||
*/
|
||||
class ImportOdsTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var ImportOds */
|
||||
protected $object;
|
||||
|
||||
@ -106,7 +114,9 @@ class ImportOdsTest extends AbstractTestCase
|
||||
$GLOBALS['import_file'] = 'test/test_data/db_test.ods';
|
||||
$_REQUEST['ods_empty_rows'] = true;
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$importHandle = new File($GLOBALS['import_file']);
|
||||
$importHandle->setDecompressContent(true);
|
||||
@ -165,7 +175,9 @@ class ImportOdsTest extends AbstractTestCase
|
||||
$_REQUEST['ods_col_names'] = true;
|
||||
$_REQUEST['ods_empty_rows'] = $odsEmptyRowsMode;
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$importHandle = new File($GLOBALS['import_file']);
|
||||
$importHandle->setDecompressContent(false);// Not compressed
|
||||
|
||||
@ -33,6 +33,20 @@ use function implode;
|
||||
*/
|
||||
class PrivilegesTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
}
|
||||
|
||||
public function testGetDataForDBInfo(): void
|
||||
{
|
||||
$_REQUEST['username'] = 'PMA_username';
|
||||
|
||||
@ -6,10 +6,12 @@ namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\RelationParameters;
|
||||
use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Encoding;
|
||||
use PhpMyAdmin\Html\MySQLDocumentation;
|
||||
use PhpMyAdmin\SqlQueryForm;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Url;
|
||||
|
||||
use function __;
|
||||
@ -20,6 +22,12 @@ use function htmlspecialchars;
|
||||
*/
|
||||
class SqlQueryFormTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var SqlQueryForm */
|
||||
private $sqlQueryForm;
|
||||
|
||||
@ -30,6 +38,9 @@ class SqlQueryFormTest extends AbstractTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setLanguage();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$this->sqlQueryForm = new SqlQueryForm(new Template());
|
||||
|
||||
//$GLOBALS
|
||||
@ -67,7 +78,9 @@ class SqlQueryFormTest extends AbstractTestCase
|
||||
$GLOBALS['cfg']['Server']['pmadb'] = 'pmadb';
|
||||
$GLOBALS['cfg']['Server']['bookmarktable'] = 'bookmarktable';
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$this->dummyDbi->addResult(
|
||||
'SHOW FULL COLUMNS FROM `PMA_db`.`PMA_table`',
|
||||
[
|
||||
|
||||
@ -6,11 +6,13 @@ namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use PhpMyAdmin\ConfigStorage\RelationCleanup;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\FieldMetadata;
|
||||
use PhpMyAdmin\Operations;
|
||||
use PhpMyAdmin\ParseAnalyze;
|
||||
use PhpMyAdmin\Sql;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use stdClass;
|
||||
|
||||
@ -23,6 +25,12 @@ use const MYSQLI_TYPE_VAR_STRING;
|
||||
*/
|
||||
class SqlTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var Sql */
|
||||
private $sql;
|
||||
|
||||
@ -34,6 +42,9 @@ class SqlTest extends AbstractTestCase
|
||||
parent::setUp();
|
||||
parent::setLanguage();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
|
||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PhpMyAdmin\Cache;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Engines\Bdb;
|
||||
use PhpMyAdmin\Engines\Berkeleydb;
|
||||
use PhpMyAdmin\Engines\Binlog;
|
||||
@ -18,6 +19,7 @@ use PhpMyAdmin\Engines\Ndbcluster;
|
||||
use PhpMyAdmin\Engines\Pbxt;
|
||||
use PhpMyAdmin\Engines\PerformanceSchema;
|
||||
use PhpMyAdmin\StorageEngine;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
use function json_encode;
|
||||
@ -27,6 +29,12 @@ use function json_encode;
|
||||
*/
|
||||
class StorageEngineTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
/** @var StorageEngine|MockObject */
|
||||
protected $object;
|
||||
|
||||
@ -37,6 +45,9 @@ class StorageEngineTest extends AbstractTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 1;
|
||||
$this->object = $this->getMockForAbstractClass(
|
||||
StorageEngine::class,
|
||||
|
||||
@ -6,7 +6,9 @@ namespace PhpMyAdmin\Tests;
|
||||
|
||||
use CodeLts\U2F\U2FServer\RegistrationRequest;
|
||||
use CodeLts\U2F\U2FServer\SignRequest;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Plugins\TwoFactor\Application;
|
||||
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
||||
use PhpMyAdmin\TwoFactor;
|
||||
|
||||
use function count;
|
||||
@ -21,10 +23,19 @@ use const JSON_UNESCAPED_SLASHES;
|
||||
*/
|
||||
class TwoFactorTest extends AbstractTestCase
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
protected $dbi;
|
||||
|
||||
/** @var DbiDummy */
|
||||
protected $dummyDbi;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
parent::setTheme();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = '';
|
||||
$GLOBALS['table'] = 'table';
|
||||
@ -66,7 +77,9 @@ class TwoFactorTest extends AbstractTestCase
|
||||
$GLOBALS['cfg']['Server']['designer_settings'] = '';
|
||||
$GLOBALS['cfg']['Server']['export_templates'] = '';
|
||||
|
||||
parent::setGlobalDbi();
|
||||
$this->dummyDbi = $this->createDbiDummy();
|
||||
$this->dbi = $this->createDatabaseInterface($this->dummyDbi);
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
|
||||
$this->dummyDbi->removeDefaultResults();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user