Skip to content

Commit bd56f5f

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [Intl] Update ICU data to 61.1 [Validator] Add Japanese translation Support phpdbg SAPI in Debug::enable() [Validator] sync validator translation id no type errors with invalid submitted data types [FrameworkBundle] Partially revert HttpCache is not longer abstract (4d075da) [Finder] Fixed leading/trailing / in filename allow html5 compatible rendering of forms with null names Change datetime input to datetime-local
2 parents a466c5b + 72393e7 commit bd56f5f

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

SplFileInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SplFileInfo extends \SplFileInfo
2828
*/
2929
public function __construct($file, $relativePath, $relativePathname)
3030
{
31-
parent::__construct($file);
31+
parent::__construct(realpath($file) ?: $file);
3232
$this->relativePath = $relativePath;
3333
$this->relativePathname = $relativePathname;
3434
}

Tests/FinderTest.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ public function testFiles()
4848
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
4949
}
5050

51+
public function testRemoveTrailingSlash()
52+
{
53+
if ('\\' === \DIRECTORY_SEPARATOR) {
54+
$this->markTestSkipped('This test cannot be run on Windows.');
55+
}
56+
57+
$finder = $this->buildFinder();
58+
59+
$expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar'));
60+
$in = '//'.realpath(self::$tmpDir).'//';
61+
62+
$this->assertIterator($expected, $finder->in($in)->files()->getIterator());
63+
}
64+
5165
public function testDepth()
5266
{
5367
$finder = $this->buildFinder();
@@ -505,8 +519,8 @@ public function testMultipleLocationsWithSubDirectories()
505519
$finder->in($locations)->depth('< 10')->name('*.neon');
506520

507521
$expected = array(
508-
__DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon',
509-
__DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon',
522+
__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon',
523+
__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon',
510524
);
511525

512526
$this->assertIterator($expected, $finder);

Tests/Iterator/FilePathsIteratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testSubPath($baseDir, array $paths, array $subPaths, array $subP
3434

3535
public function getSubPathData()
3636
{
37-
$tmpDir = sys_get_temp_dir().'/symfony_finder';
37+
$tmpDir = sys_get_temp_dir().DIRECTORY_SEPARATOR.'symfony_finder';
3838

3939
return array(
4040
array(

0 commit comments

Comments
 (0)