filerepo: always use realpath()
The suffix to strip was determined using realpath() but applied on
the given path. This could lead to errors when the path is made of
a symbolic link or use consecutives slashes.
Example on Mac OS:
$ php -a
php > print realpath( '/private///tmp' );
/private/tmp
php > print realpath( '///tmp///////' );
/private/tmp
php >
$
Fix FileBackendTest::testGetFileList test which failed with:
1) FileBackendTest::testGetFileList
Correct file listing (FSFileBackend).
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
- 0 => 'subdir1/test1.txt'
- 1 => 'subdir1/test2.txt'
- 2 => 'subdir2/subdir/sub/120-px-file.txt'
- 3 => 'subdir2/subdir/sub/test0.txt'
- 4 => 'subdir2/subdir/test1.txt'
- 5 => 'subdir2/subdir/test2.txt'
- 6 => 'subdir2/subdir/test3.txt'
- 7 => 'subdir2/subdir/test4.txt'
- 8 => 'subdir2/subdir/test5.txt'
- 9 => 'subdir2/test3.txt'
- 10 => 'subdir2/test4.txt'
- 11 => 'test1.txt'
- 12 => 'test2.txt'
- 13 => 'test3.txt'
+ 0 => '/subdir/sub/120-px-file.txt'
+ 1 => '/subdir/sub/test0.txt'
+ 2 => '/subdir/test1.txt'
+ 3 => '/subdir/test2.txt'
+ 4 => '/subdir/test3.txt'
+ 5 => '/subdir/test4.txt'
+ 6 => '/subdir/test5.txt'
+ 7 => '/test1.txt'
+ 8 => '/test2.txt'
+ 9 => '/test3.txt'
+ 10 => '/test4.txt'
+ 11 => 'xt'
+ 12 => 'xt'
+ 13 => 'xt'
)