phpmyadmin/test/classes/ProfilingTest.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

29 lines
680 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests;
use PhpMyAdmin\Profiling;
use PhpMyAdmin\Utils\SessionCache;
/**
* @covers \PhpMyAdmin\Profiling
*/
class ProfilingTest extends AbstractTestCase
{
public function testIsSupported(): void
{
$GLOBALS['dbi'] = $this->createDatabaseInterface();
$GLOBALS['server'] = 1;
SessionCache::set('profiling_supported', true);
$condition = Profiling::isSupported($GLOBALS['dbi']);
$this->assertTrue($condition);
SessionCache::set('profiling_supported', false);
$condition = Profiling::isSupported($GLOBALS['dbi']);
$this->assertFalse($condition);
}
}