public/phpmyadmin/test/classes/Controllers/Server/ServerEnginesControllerTest.php
/**
     * Tests for _getHtmlForServerEngine() method
     *
     * @return void
     */
Tests for _getHtmlForServerEngine() method
@return void
Tests for _getHtmlForServerEngine () method @return void
public function testGetHtmlForServerEngine()
    {
        $_REQUEST['engine'] = "Pbxt";
        $_REQUEST['page'] = "page";
        $dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface')
            ->disableOriginalConstructor()
            ->getMock();
        $GLOBALS['dbi'] = $dbi;
        $class = new ReflectionClass('\PhpMyAdmin\Controllers\Server\ServerEnginesController');
        $method = $class->getMethod('_getHtmlForServerEngine');
        $method->setAccessible(true);
        $engine_plugin = StorageEngine::getEngine("Pbxt");
        $ctrl = new ServerEnginesController(
            $this->container->get('response'),
            $this->container->get('dbi')
        );
        $html = $method->invoke($ctrl, $engine_plugin);
        $this->assertContains(
            htmlspecialchars($engine_plugin->getTitle()),
            $html
        );
        $this->assertContains(
            Util::showMySQLDocu($engine_plugin->getMysqlHelpPage()),
            $html
        );
        $this->assertContains(
            htmlspecialchars($engine_plugin->getComment()),
            $html
        );
        $this->assertContains(
            __('Variables'),
            $html
        );
        $this->assertContains(
            Url::getCommon(
                array('engine' => $_REQUEST['engine'], 'page' => "Documentation")
            ),
            $html
        );
        $this->assertContains(
            Url::getCommon(array('engine' => $_REQUEST['engine'])),
            $html
        );
        $this->assertContains(
            $engine_plugin->getSupportInformationMessage(),
            $html
        );
        $this->assertContains(
            'There is no detailed status information available for this '
            . 'storage engine.',
            $html
        );
    }
public function testGetHtmlForServerEngine ( ) { $ _REQUEST [ 'engine' ] = " Pbxt " ; $ _REQUEST [ 'page' ] = " page " ; $ dbi = $ this -> getMockBuilder ( 'PhpMyAdmin\DatabaseInterface' ) -> disableOriginalConstructor ( ) -> getMock ( ) ; $ GLOBALS [ 'dbi' ] = $ dbi ; $ class = new ReflectionClass ( '\PhpMyAdmin\Controllers\Server\ServerEnginesController' ) ; $ method = $ class -> getMethod ( '_getHtmlForServerEngine' ) ; $ method -> setAccessible ( true ) ; $ engine_plugin = StorageEngine :: getEngine ( " Pbxt " ) ; $ ctrl = new ServerEnginesController ( $ this -> container -> get ( 'response' ) , $ this -> container -> get ( 'dbi' ) ) ; $ html = $ method -> invoke ( $ ctrl , $ engine_plugin ) ; $ this -> assertContains ( htmlspecialchars ( $ engine_plugin -> getTitle ( ) ) , $ html ) ; $ this -> assertContains ( Util :: showMySQLDocu ( $ engine_plugin -> getMysqlHelpPage ( ) ) , $ html ) ; $ this -> assertContains ( htmlspecialchars ( $ engine_plugin -> getComment ( ) ) , $ html ) ; $ this -> assertContains ( __ ( 'Variables' ) , $ html ) ; $ this -> assertContains ( Url :: getCommon ( array ( 'engine' => $ _REQUEST [ 'engine' ] , 'page' => " Documentation " ) ) , $ html ) ; $ this -> assertContains ( Url :: getCommon ( array ( 'engine' => $ _REQUEST [ 'engine' ] ) ) , $ html ) ; $ this -> assertContains ( $ engine_plugin -> getSupportInformationMessage ( ) , $ html ) ; $ this -> assertContains ( 'There is no detailed status information available for this ' . 'storage engine.' , $ html ) ; }
Tests for _getHtmlForServerEngine() method
 @return void
Tests for _getHtmlForServerEngine () method @return void
//Mock DBI //validate 1: Engine title //validate 2: Engine Mysql Help Page //validate 3: Engine Comment //validate 4: Engine Info Pages //validate 5: other items