Skip to content

Commit 64424bc

Browse files
committed
MAGETWO-67626: Auto-generated classes behave differently in unit tests and application
- removed 'generated' folder from base application autoload paths
1 parent e47ac7d commit 64424bc

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

app/autoload.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,3 @@
3535
}
3636

3737
AutoloaderRegistry::registerAutoloader(new ClassLoaderWrapper($composerAutoloader));
38-
39-
// Sets default autoload mappings, may be overridden in Bootstrap::create
40-
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);

app/bootstrap.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
}
2929

3030
require_once __DIR__ . '/autoload.php';
31+
// Sets default autoload mappings, may be overridden in Bootstrap::create
32+
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);
33+
3134
require_once BP . '/app/functions.php';
3235

3336
/* Custom umask value may be provided in optional mage_umask file in root */

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@
236236
},
237237
"psr-0": {
238238
"": [
239-
"app/code/",
240-
"generated/code"
239+
"app/code/"
241240
]
242241
},
243242
"files": [

lib/internal/Magento/Framework/Autoload/Populator.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace Magento\Framework\Autoload;
77

88
use Magento\Framework\App\Filesystem\DirectoryList;
9-
use Magento\Framework\Autoload\AutoloaderInterface;
109
use Magento\Framework\Filesystem\FileResolver;
1110

1211
/**
@@ -23,16 +22,9 @@ class Populator
2322
public static function populateMappings(AutoloaderInterface $autoloader, DirectoryList $dirList)
2423
{
2524
$generationDir = $dirList->getPath(DirectoryList::GENERATED_CODE);
26-
$frameworkDir = $dirList->getPath(DirectoryList::LIB_INTERNAL);
2725

2826
$autoloader->addPsr4('Magento\\', [$generationDir . '/Magento/'], true);
2927

30-
$autoloader->addPsr0('Cm_', $frameworkDir, true);
31-
$autoloader->addPsr0('Credis_', $frameworkDir, true);
32-
33-
/** Required for Zend functionality */
34-
FileResolver::addIncludePath($frameworkDir);
35-
3628
/** Required for code generation to occur */
3729
FileResolver::addIncludePath($generationDir);
3830

0 commit comments

Comments
 (0)