phpmyadmin/test/classes/ResponseTest.php
Maurício Meneghini Fauth 346923e20a
Set dbi only when the test needs it
Related to https://github.com/phpmyadmin/phpmyadmin/pull/17637

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-07-14 02:21:45 -03:00

35 lines
774 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests;
use PhpMyAdmin\ResponseRenderer;
/**
* @covers \PhpMyAdmin\ResponseRenderer
*/
class ResponseTest extends AbstractTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['dbi'] = $this->createDatabaseInterface();
$GLOBALS['lang'] = 'en';
$GLOBALS['server'] = 1;
$GLOBALS['text_dir'] = 'ltr';
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
}
public function testSetAjax(): void
{
$_REQUEST = [];
$response = ResponseRenderer::getInstance();
$response->setAjax(true);
$this->assertTrue($response->isAjax());
$response->setAjax(false);
$this->assertFalse($response->isAjax());
}
}