Integration Test failed on Windows because Espo Bool Type for doctrine could not been found.

This commit is contained in:
Sebastian Foerster
2017-11-14 20:54:03 +01:00
parent 26bbd6672f
commit 5eb2b92397
2 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -447,7 +447,7 @@ class Util
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;
+16 -3
View File
@@ -1150,15 +1150,28 @@ class UtilTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($testResult, Util::replaceInArray('{0}', 'DONE', $testArray, true));
}
public function testGetClassName()
/**
* @dataProvider dp_classNames
*/
public function testGetClassName($path, $expectedClassName = '\Espo\EntryPoints\Donwload')
{
$this->assertEquals('\Espo\EntryPoints\Donwload', Util::getClassName('application/Espo/EntryPoints/Donwload.php'));
$this->assertEquals($expectedClassName, Util::getClassName($path));
$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'));
}
public function dp_classNames()
{
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()
{
$input = array(