New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unittests on windows failed #694

Merged
merged 5 commits into from Nov 15, 2017
@@ -447,7 +447,7 @@ public static function unsetInArray(array $content, $unsets, $unsetParentEmptyAr
public static function getClassName($filePath)
{
$className = preg_replace('/\.php$/i', '', $filePath);
$className = preg_replace('/^(application|custom)\//i', '', $className);
$className = preg_replace('/^(application|custom)(\/|\\\)/i', '', $className);
$className = '\\'.static::toFormat($className, '\\');
return $className;
@@ -1150,13 +1150,23 @@ public function testReplaceInArray()
$this->assertEquals($testResult, Util::replaceInArray('{0}', 'DONE', $testArray, true));
}
/**
* @dataProvider dp_classNames
*/
public function testGetClassName($path, $expectedClassName = '\Espo\EntryPoints\Donwload')
{
$this->assertEquals($expectedClassName, Util::getClassName($path));
}
public function testGetClassName()
public function dp_classNames()
{
$this->assertEquals('\Espo\EntryPoints\Donwload', Util::getClassName('application/Espo/EntryPoints/Donwload.php'));
$this->assertEquals('\Espo\EntryPoints\Donwload', Util::getClassName('custom/Espo/EntryPoints/Donwload.php'));
$this->assertEquals('\Espo\EntryPoints\Donwload', Util::getClassName('Espo/EntryPoints/Donwload.php'));
$this->assertEquals('\Espo\EntryPoints\Donwload', Util::getClassName('application/Espo/EntryPoints/Donwload'));
return [
"application/Espo/EntryPoints/Donwload.php" => ['application/Espo/EntryPoints/Donwload.php'],
"custom/Espo/EntryPoints/Donwload.php" => ['custom/Espo/EntryPoints/Donwload.php'],
"Espo/EntryPoints/Donwload.php" => ['Espo/EntryPoints/Donwload.php'],
"application/Espo/EntryPoints/Donwload" => ['application/Espo/EntryPoints/Donwload'],
"\application\Espo\EntryPoints\Donwload" => ['application\Espo\EntryPoints\Donwload'],
];
}
public function testUnsetInArrayNotSingle()
ProTip! Use n and p to navigate between commits in a pull request.