added a new fileManager test, fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)) );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user