2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Tests for PMA_securePath() from libraries/core.lib.php
5 * PMA_securePath changes .. to .
7 * @package phpMyAdmin-test
10 require_once 'libraries/core.lib.php';
12 class PMA_securePath
extends PHPUnit_Framework_TestCase
14 public function testReplaceDots(){
15 $this->assertEquals(PMA_securePath('../../../etc/passwd'), './././etc/passwd');
16 $this->assertEquals(PMA_securePath('/var/www/../phpmyadmin'), '/var/www/./phpmyadmin');
17 $this->assertEquals(PMA_securePath('./path/with..dots/../../file..php'), './path/with.dots/././file.php');