You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 27, 2023. It is now read-only.
# EcomDev_PHPUnit_Model_Yaml_Loader_Global
/**
* Returns processed file path
*
* @param string $fileName
* @param string $relatedClassName
* @param string $type
* @return string|bool
*/
protected function _getFilePath($fileName, $relatedClassName, $type)
{
$reflection = EcomDev_Utils_Reflection::getReflection($relatedClassName);
$fileObject = new SplFileInfo($reflection->getFileName());
$basePath = $fileObject->getPath();
// While base path is within a base directory of Magento installment
while (strpos($basePath, Mage::getBaseDir()) && !is_dir($basePath . DS . $type)) {
$basePath = dirname($basePath);
}
if (basename($basePath)) {
return $basePath . DS . $type . DS .$fileName;
}
return false;
}
Lets assume the base path is '/var/www/html/magento/tests' and the base dir is '/var/www/html/magento', strpos will evaluate to 0, which then will be interpreted as false.
// While base path is within a base directory of Magento installment
while (false !== strpos($basePath, Mage::getBaseDir()) && !is_dir($basePath . DS . $type)) {
$basePath = dirname($basePath);
}
Are my assumptions correct or is there anything i missed? This are my points
Hello,
it seems like that the following check is wrong
Lets assume the base path is '/var/www/html/magento/tests' and the base dir is '/var/www/html/magento', strpos will evaluate to 0, which then will be interpreted as false.
Correct
Are my assumptions correct or is there anything i missed? This are my points
The text was updated successfully, but these errors were encountered: