phpmyadmin/test/libraries/common/PMA_showDocu_test.php
Michal Čihař e56949f160 Use package name PhpMyAdmin
Needed to match phpdoc rules as package name must begin with upper case.
2011-10-25 10:13:17 +02:00

50 lines
1.3 KiB
PHP

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test for PMA_showDocu from common.lib.php
*
* @package PhpMyAdmin-test
* @version $Id: PMA_showDocu.php
* @group common.lib-tests
*/
/*
* Include to test.
*/
require_once 'libraries/common.lib.php';
require_once 'libraries/Theme.class.php';
class PMA_showDocu_test extends PHPUnit_Framework_TestCase
{
function setup()
{
$_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
}
function testShowDocuReplaceHelpImg()
{
$GLOBALS['cfg']['ReplaceHelpImg'] = true;
$anchor = "relation";
$expected = '<a href="Documentation.html#' . $anchor . '" target="documentation">'
. '<img src="themes/dot.gif" title="' . __('Documentation') . '" '
. 'alt="' . __('Documentation') . '" class="icon ic_b_help" /></a>';
$this->assertEquals($expected, PMA_showDocu($anchor));
}
function testShowDocuNotReplaceHelpImg()
{
$GLOBALS['cfg']['ReplaceHelpImg'] = false;
$anchor = "relation";
$expected = '[<a href="Documentation.html#' . $anchor . '" target="documentation">'
. __('Documentation')
. '</a>]';
$this->assertEquals($expected, PMA_showDocu($anchor));
}
}