phpmyadmin/test/libraries/core/PMA_securePath_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

39 lines
776 B
PHP

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* PMA_securePath changes .. to .
*
* @package PhpMyAdmin-test
*/
/**
* Test for securing path.
*
* @package PhpMyAdmin-test
*/
class PMA_SecurePath extends PHPUnit_Framework_TestCase
{
/**
* Test for replacing dots.
*
* @return void
*/
public function testReplaceDots()
{
$this->assertEquals(
PMA_securePath('../../../etc/passwd'),
'./././etc/passwd'
);
$this->assertEquals(
PMA_securePath('/var/www/../phpmyadmin'),
'/var/www/./phpmyadmin'
);
$this->assertEquals(
PMA_securePath('./path/with..dots/../../file..php'),
'./path/with.dots/././file.php'
);
}
}