Passed
Push — master ( 7e5896...7b669a )
by Maurício
08:42
created

ResponseTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin\Tests;
6
7
use PhpMyAdmin\Response;
8
9
/**
10
 * @covers \PhpMyAdmin\Response
11
 */
12
class ResponseTest extends AbstractTestCase
13
{
14
    protected function setUp(): void
15
    {
16
        parent::setUp();
17
18
        $GLOBALS['config']->enableBc();
19
        $GLOBALS['lang'] = 'en';
20
        $GLOBALS['server'] = 1;
21
        $GLOBALS['text_dir'] = 'ltr';
22
        $GLOBALS['PMA_PHP_SELF'] = 'index.php';
23
    }
24
25
    public function testSetAjax(): void
26
    {
27
        $_REQUEST = [];
28
        $response = Response::getInstance();
29
        $response->setAjax(true);
30
        $this->assertTrue($response->isAjax());
31
        $response->setAjax(false);
32
        $this->assertFalse($response->isAjax());
33
    }
34
}
35