added a new fileManager test, fixes

This commit is contained in:
Taras Machyshyn
2015-02-17 12:03:55 +02:00
parent ebdb649bd7
commit b6010a7ad7
2 changed files with 19 additions and 3 deletions
+1 -1
View File
@@ -839,7 +839,7 @@ return '.var_export($content, true).';
$fullPath = $this->concatPaths($path);
if (!file_exists($fullPath)) {
$fullPath = $this->getExistsPath($fullPath, PATHINFO_DIRNAME);
$fullPath = $this->getExistsPath(pathinfo($fullPath, PATHINFO_DIRNAME));
}
return $fullPath;
+18 -2
View File
@@ -1,4 +1,4 @@
<?php
<?php
/************************************************************************
* This file is part of EspoCRM.
*
@@ -389,7 +389,23 @@ class ManagerTest extends \PHPUnit_Framework_TestCase
}
}
public function existsPathSet()
{
return array(
array( 'application/Espo/Core/Application.php', 'application/Espo/Core/Application.php', ),
array( 'application/Espo/Core/NotRealApplication.php', 'application/Espo/Core'),
array( array('application', 'Espo/Core', 'NotRealApplication.php'), 'application/Espo/Core'),
array( 'application/NoEspo/Core/Application.php', 'application'),
array( 'notRealPath/Espo/Core/Application.php', '.'),
);
}
/**
* @dataProvider existsPathSet
*/
public function testGetExistsPath($input, $result)
{
$this->assertEquals($result, $this->reflection->invokeMethod('getExistsPath', array($input)) );
}
}
?>