File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
dev/tests/unit/testsuite/Magento/Setup/Model
setup/src/Magento/Setup/Model Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,13 @@ public function testCheckApplicationFilePermissions()
314
314
315
315
public function testUpdateModulesSequence ()
316
316
{
317
+ $ varDir = $ this ->getMockForAbstractClass ('Magento\Framework\Filesystem\Directory\WriteInterface ' );
318
+ $ varDir ->expects ($ this ->once ())->method ('getAbsolutePath ' )->willReturn ('/var ' );
319
+ $ this ->filesystem
320
+ ->expects ($ this ->once ())
321
+ ->method ('getDirectoryWrite ' )
322
+ ->willReturn ($ varDir );
323
+
317
324
$ allModules = [
318
325
'Foo_One ' => [],
319
326
'Bar_Two ' => [],
@@ -327,13 +334,18 @@ public function testUpdateModulesSequence()
327
334
'New_Module ' => 1
328
335
];
329
336
337
+ $ this ->config ->expects ($ this ->atLeastOnce ())->method ('isAvailable ' )->willReturn (true );
330
338
$ this ->deploymentConfigFactory ->expects ($ this ->once ())->method ('create ' )->with ($ expectedModules )
331
339
->willReturn ($ this ->deploymentConfig );
332
340
333
341
$ newObject = $ this ->createObject (false , false );
334
342
$ this ->configReader ->expects ($ this ->once ())->method ('load ' )
335
343
->willReturn (['modules ' => ['Bar_Two ' => 0 , 'Foo_One ' => 1 , 'Old_Module ' => 0 ] ]);
336
344
$ this ->configWriter ->expects ($ this ->once ())->method ('update ' )->with ($ this ->deploymentConfig );
345
+ $ this ->logger ->expects ($ this ->at (0 ))->method ('log ' )->with ('File system cleanup: ' );
346
+ $ this ->logger ->expects ($ this ->at (1 ))->method ('log ' )
347
+ ->with ('The directory \'/var \' doesn \'t exist - skipping cleanup ' );
348
+ $ this ->logger ->expects ($ this ->at (2 ))->method ('log ' )->with ('Updating modules: ' );
337
349
$ newObject ->updateModulesSequence ();
338
350
}
339
351
Original file line number Diff line number Diff line change @@ -815,6 +815,9 @@ public function installAdminUser($data)
815
815
public function updateModulesSequence ()
816
816
{
817
817
$ this ->assertDeploymentConfigExists ();
818
+ $ this ->log ->log ('File system cleanup: ' );
819
+ $ this ->deleteDirContents (DirectoryList::VAR_DIR );
820
+ $ this ->log ->log ('Updating modules: ' );
818
821
$ allModules = array_keys ($ this ->moduleLoader ->load ());
819
822
$ deploymentConfig = $ this ->deploymentConfigReader ->load ();
820
823
$ currentModules = isset ($ deploymentConfig ['modules ' ]) ? $ deploymentConfig ['modules ' ] : [] ;
You can’t perform that action at this time.
0 commit comments