1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-11-01 23:14:58 +03:00
Files
phpmyadmin/test/libraries/core/PMA_checkPageValidity_test.php
Michal Čihař b450e58dbb Remove require of libraries included in test bootstrap
There is no need to specify them in every test when we already do it
globally.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-12 16:43:16 +01:00

69 lines
1.6 KiB
PHP

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @package PhpMyAdmin-test
*/
/*
* Include to test.
*/
/**
*
* @package PhpMyAdmin-test
*/
class PMA_CheckPageValidity_Test extends PHPUnit_Framework_TestCase
{
protected $goto_whitelist = array(
'db_datadict.php',
'db_sql.php',
'db_export.php',
'db_search.php',
'export.php',
'import.php',
'index.php',
'pdf_pages.php',
'pdf_schema.php',
'server_binlog.php',
'server_variables.php',
'sql.php',
'tbl_select.php',
'transformation_overview.php',
'transformation_wrapper.php',
'user_password.php',
);
/**
* Test for PMA_checkPageValidity
*
* @param string $page Page
* @param array|null $whiteList White list
* @param int $expected Expected value
*
* @return void
*
* @dataProvider provider
*/
function testGotoNowhere($page, $whiteList, $expected)
{
$this->assertTrue($expected === PMA_checkPageValidity($page, $whiteList));
}
/**
* Data provider for testGotoNowhere
*
* @return array
*/
public function provider()
{
return array(
array(null, null, false),
array('export.php', $this->goto_whitelist, true),
array('shell.php', $this->goto_whitelist, false),
array('index.php?sql.php&test=true', $this->goto_whitelist, true),
array('index.php%3Fsql.php%26test%3Dtrue', $this->goto_whitelist, true),
);
}
}