object = new DisplayResults('as', '', 0, '', ''); $GLOBALS['config']->enableBc(); $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['cfg']['Server']['DisableIS'] = false; $_SESSION[' HMAC_secret '] = 'test'; $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() ->getMock(); $GLOBALS['dbi'] = $dbi; } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown(): void { parent::tearDown(); unset($this->object); } /** * Test for isSelect function */ public function testisSelect(): void { $parser = new Parser('SELECT * FROM pma'); $this->assertTrue( $this->callFunction( $this->object, DisplayResults::class, 'isSelect', [ [ 'statement' => $parser->statements[0], 'select_from' => true, ], ] ) ); } /** * Test for navigation buttons * * @param string $caption iconic caption for button * @param string $title text for button * @param int $pos position for next query * @param string $html_sql_query query ready for display * * @dataProvider providerForTestGetTableNavigationButton */ public function testGetTableNavigationButton( string $caption, string $title, int $pos, string $html_sql_query ): void { $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons'; $_SESSION[' PMA_token '] = 'token'; $actual = $this->callFunction( $this->object, DisplayResults::class, 'getTableNavigationButton', [ &$caption, $title, $pos, $html_sql_query, true, ] ); $this->assertStringContainsString( '