diff options
author | Frédéric Guillot <fred@kanboard.net> | 2018-04-04 15:21:13 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2018-04-04 15:21:13 -0700 |
commit | a4642d17e0e1ea018b128efdcc3db281461458b1 (patch) | |
tree | 00210c3d0abd0adea7f8817e6ba1d82c1ea4b50e /vendor/symfony | |
parent | 62178b1f2b4ad6ed8eafbcd3be8ef2f46b041b82 (diff) |
Move custom libs to the source tree
Diffstat (limited to 'vendor/symfony')
-rw-r--r-- | vendor/symfony/finder/SplFileInfo.php | 2 | ||||
-rw-r--r-- | vendor/symfony/finder/Tests/FinderTest.php | 18 |
2 files changed, 17 insertions, 3 deletions
diff --git a/vendor/symfony/finder/SplFileInfo.php b/vendor/symfony/finder/SplFileInfo.php index 19f95e26..2cf3a27f 100644 --- a/vendor/symfony/finder/SplFileInfo.php +++ b/vendor/symfony/finder/SplFileInfo.php @@ -28,7 +28,7 @@ class SplFileInfo extends \SplFileInfo */ public function __construct($file, $relativePath, $relativePathname) { - parent::__construct($file); + parent::__construct(realpath($file) ?: $file); $this->relativePath = $relativePath; $this->relativePathname = $relativePathname; } diff --git a/vendor/symfony/finder/Tests/FinderTest.php b/vendor/symfony/finder/Tests/FinderTest.php index 7e75f141..634f731a 100644 --- a/vendor/symfony/finder/Tests/FinderTest.php +++ b/vendor/symfony/finder/Tests/FinderTest.php @@ -46,6 +46,20 @@ class FinderTest extends Iterator\RealIteratorTestCase $this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator()); } + public function testRemoveTrailingSlash() + { + if ('\\' === \DIRECTORY_SEPARATOR) { + $this->markTestSkipped('This test cannot be run on Windows.'); + } + + $finder = $this->buildFinder(); + + $expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')); + $in = '//'.realpath(self::$tmpDir).'//'; + + $this->assertIterator($expected, $finder->in($in)->files()->getIterator()); + } + public function testDepth() { $finder = $this->buildFinder(); @@ -514,8 +528,8 @@ class FinderTest extends Iterator\RealIteratorTestCase $finder->in($locations)->depth('< 10')->name('*.neon'); $expected = array( - __DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon', - __DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon', + __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon', + __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon', ); $this->assertIterator($expected, $finder); |