Changed parameter name in Filesystem::findShortestPath
parent
1f8c9eeb6c
commit
36d9513d7b
|
@ -58,10 +58,10 @@ class Filesystem
|
||||||
*
|
*
|
||||||
* @param string $from
|
* @param string $from
|
||||||
* @param string $to
|
* @param string $to
|
||||||
* @param Boolean $inDirectory if true, the source is considered to be in the directory
|
* @param Boolean $directories if true, the source/target are considered to be directories
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function findShortestPath($from, $to, $inDirectory = false)
|
public function findShortestPath($from, $to, $directories = false)
|
||||||
{
|
{
|
||||||
if (!$this->isAbsolutePath($from) || !$this->isAbsolutePath($to)) {
|
if (!$this->isAbsolutePath($from) || !$this->isAbsolutePath($to)) {
|
||||||
throw new \InvalidArgumentException('from and to must be absolute paths');
|
throw new \InvalidArgumentException('from and to must be absolute paths');
|
||||||
|
@ -70,7 +70,7 @@ class Filesystem
|
||||||
$from = lcfirst(rtrim(strtr($from, '\\', '/'), '/'));
|
$from = lcfirst(rtrim(strtr($from, '\\', '/'), '/'));
|
||||||
$to = lcfirst(rtrim(strtr($to, '\\', '/'), '/'));
|
$to = lcfirst(rtrim(strtr($to, '\\', '/'), '/'));
|
||||||
|
|
||||||
if ($inDirectory) {
|
if ($directories) {
|
||||||
$from .= '/dummy_file';
|
$from .= '/dummy_file';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,10 @@ class FilesystemTest extends TestCase
|
||||||
/**
|
/**
|
||||||
* @dataProvider providePathCouples
|
* @dataProvider providePathCouples
|
||||||
*/
|
*/
|
||||||
public function testFindShortestPath($a, $b, $expected, $inDirectory = false)
|
public function testFindShortestPath($a, $b, $expected, $directory = false)
|
||||||
{
|
{
|
||||||
$fs = new Filesystem;
|
$fs = new Filesystem;
|
||||||
$this->assertEquals($expected, $fs->findShortestPath($a, $b, $inDirectory));
|
$this->assertEquals($expected, $fs->findShortestPath($a, $b, $directory));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providePathCouples()
|
public function providePathCouples()
|
||||||
|
|
Loading…
Reference in New Issue