File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ public function build()
45
45
// Locate composer.json for magento2-base module and read the extra map section for the list of
46
46
// magento specific files and directories that updater will need access to perform the upgrade
47
47
48
+ $ filesPathList = [];
48
49
$ vendorDir = require VENDOR_PATH ;
49
50
$ basePackageComposerFilePath = $ vendorDir . '/ ' . self ::MAGENTO_BASE_PACKAGE_COMPOSER_JSON_FILE ;
50
51
if (!$ this ->reader ->isExist ($ basePackageComposerFilePath )) {
@@ -59,17 +60,12 @@ public function build()
59
60
}
60
61
$ composerJsonFileData = json_decode ($ this ->reader ->readFile ($ basePackageComposerFilePath ), true );
61
62
if (!isset ($ composerJsonFileData [self ::COMPOSER_KEY_EXTRA ][self ::COMPOSER_KEY_MAP ])) {
62
- throw new \Magento \Setup \Exception (
63
- 'Could not find "extra" => "map" section within '
64
- . self ::MAGENTO_BASE_PACKAGE_COMPOSER_JSON_FILE
65
- . ' file. '
66
- );
63
+ return $ filesPathList ;
67
64
}
68
65
$ extraMappings = $ composerJsonFileData [self ::COMPOSER_KEY_EXTRA ][self ::COMPOSER_KEY_MAP ];
69
- $ fileAndPathList = [];
70
66
foreach ($ extraMappings as $ map ) {
71
- $ fileAndPathList [] = $ map [1 ];
67
+ $ filesPathList [] = $ map [1 ];
72
68
}
73
- return $ fileAndPathList ;
69
+ return $ filesPathList ;
74
70
}
75
71
}
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public function testBuildComposerJsonFileNotReadable()
70
70
$ this ->pathBuilder ->build ();
71
71
}
72
72
73
- // Error scenario : ["extra"]["map"] is absent within magento/magento2-base/composer.json file
73
+ // Scenario : ["extra"]["map"] is absent within magento/magento2-base/composer.json file
74
74
public function testBuildNoExtraMapSectionInComposerJsonFile ()
75
75
{
76
76
$ this ->readerMock ->expects ($ this ->once ())->method ('isExist ' )->willReturn (true );
@@ -85,14 +85,9 @@ public function testBuildNoExtraMapSectionInComposerJsonFile()
85
85
]
86
86
);
87
87
$ this ->readerMock ->expects ($ this ->once ())->method ('readFile ' )->willReturn ($ jsonData );
88
- $ this ->setExpectedException (
89
- 'Magento\Setup\Exception ' ,
90
- sprintf (
91
- 'Could not find "extra" => "map" section within %s file. ' ,
92
- PathBuilder::MAGENTO_BASE_PACKAGE_COMPOSER_JSON_FILE
93
- )
94
- );
95
- $ this ->pathBuilder ->build ();
88
+ $ expectedList = [];
89
+ $ actualList = $ this ->pathBuilder ->build ();
90
+ $ this ->assertEquals ($ expectedList , $ actualList );
96
91
}
97
92
98
93
// Success scenario
You can’t perform that action at this time.
0 commit comments