Skip to content

Commit f86b4c4

Browse files
fix tests
1 parent 681ff33 commit f86b4c4

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_linebreaks.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2+
In ApplicationTest.php line 761:
23

3-
[InvalidArgumentException]
44
line 1 with extra spaces
55
line 2
66

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,6 @@ public function providePathsForMakePathRelative()
11011101
array('/var/lib/symfony/src/Symfony', '/var/lib/symfony/src/Symfony/Component', '../'),
11021102
array('/var/lib/symfony/src/Symfony', '/var/lib/symfony/src/Symfony/Component/', '../'),
11031103
array('/usr/lib/symfony/', '/var/lib/symfony/src/Symfony/Component', '../../../../../../usr/lib/symfony/'),
1104-
array('usr/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../../../../usr/lib/symfony/'),
11051104
array('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/', 'src/Symfony/'),
11061105
array('/aa/bb', '/aa/bb', './'),
11071106
array('/aa/bb', '/aa/bb/', './'),
@@ -1133,17 +1132,6 @@ public function providePathsForMakePathRelative()
11331132
array('C:/aa/bb/../../cc', 'C:/aa/../dd/..', 'cc/'),
11341133
array('C:/../aa/bb/cc', 'C:/aa/dd/..', 'bb/cc/'),
11351134
array('C:/../../aa/../bb/cc', 'C:/aa/dd/..', '../bb/cc/'),
1136-
array('aa/bb', 'aa/cc', '../bb/'),
1137-
array('aa/cc', 'bb/cc', '../../aa/cc/'),
1138-
array('aa/bb', 'aa/./cc', '../bb/'),
1139-
array('aa/./bb', 'aa/cc', '../bb/'),
1140-
array('aa/./bb', 'aa/./cc', '../bb/'),
1141-
array('../../', '../../', './'),
1142-
array('../aa/bb/', 'aa/bb/', '../../../aa/bb/'),
1143-
array('../../../', '../../', '../'),
1144-
array('', '', './'),
1145-
array('', 'aa/', '../'),
1146-
array('aa/', '', 'aa/'),
11471135
);
11481136

11491137
if ('\\' === DIRECTORY_SEPARATOR) {
@@ -1155,11 +1143,32 @@ public function providePathsForMakePathRelative()
11551143

11561144
/**
11571145
* @group legacy
1146+
* @dataProvider provideLegacyPathsForMakePathRelativeWithRelativePaths
11581147
* @expectedDeprecation Support for passing relative paths to Symfony\Component\Filesystem\Filesystem::makePathRelative() is deprecated since version 3.4 and will be removed in 4.0.
11591148
*/
1160-
public function testMakePathRelativeWithRelativePaths()
1149+
public function testMakePathRelativeWithRelativePaths($endPath, $startPath, $expectedPath)
1150+
{
1151+
$path = $this->filesystem->makePathRelative($endPath, $startPath);
1152+
1153+
$this->assertEquals($expectedPath, $path);
1154+
}
1155+
1156+
public function provideLegacyPathsForMakePathRelativeWithRelativePaths()
11611157
{
1162-
$this->assertSame('../../../', $this->filesystem->makePathRelative('var/lib/symfony/', 'var/lib/symfony/src/Symfony/Component'));
1158+
return array(
1159+
array('usr/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../../../../usr/lib/symfony/'),
1160+
array('aa/bb', 'aa/cc', '../bb/'),
1161+
array('aa/cc', 'bb/cc', '../../aa/cc/'),
1162+
array('aa/bb', 'aa/./cc', '../bb/'),
1163+
array('aa/./bb', 'aa/cc', '../bb/'),
1164+
array('aa/./bb', 'aa/./cc', '../bb/'),
1165+
array('../../', '../../', './'),
1166+
array('../aa/bb/', 'aa/bb/', '../../../aa/bb/'),
1167+
array('../../../', '../../', '../'),
1168+
array('', '', './'),
1169+
array('', 'aa/', '../'),
1170+
array('aa/', '', 'aa/'),
1171+
);
11631172
}
11641173

11651174
public function testMirrorCopiesFilesAndDirectoriesRecursively()

0 commit comments

Comments
 (0)