Skip to content

Commit 0c074c4

Browse files
committed
B2B-1785: Cannot enable remote storage with install command when modules are not enabled
1 parent 2c04872 commit 0c074c4

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
use Magento\Framework\Setup\SampleData\State;
3939
use Magento\Framework\Setup\SchemaListener;
4040
use Magento\Framework\Validation\ValidationException;
41+
use Magento\RemoteStorage\Driver\DriverException;
4142
use Magento\Setup\Controller\ResponseTypeInterface;
4243
use Magento\Setup\Model\AdminAccount;
4344
use Magento\Setup\Model\AdminAccountFactory;
@@ -889,11 +890,12 @@ public function testInstallWithUnresolvableRemoteStorageValidator()
889890
* Test installation with invalid remote storage configuration is able to be caught earlier than
890891
* the queued validation step if necessary, and that configuration is reverted back to local file driver.
891892
*
893+
* @dataProvider installWithInvalidRemoteStorageConfigurationWithEarlyExceptionDataProvider
892894
* @throws \Magento\Framework\Exception\FileSystemException
893895
* @throws \Magento\Framework\Exception\LocalizedException
894896
* @throws \Magento\Framework\Exception\RuntimeException
895897
*/
896-
public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyRuntimeException()
898+
public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyException(\Exception $exception)
897899
{
898900
$request = $this->request;
899901

@@ -921,9 +923,9 @@ public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyRuntime
921923
$this->declarationInstallerMock
922924
->expects(static::once())
923925
->method('installSchema')
924-
->willThrowException(new RuntimeException(__('Remote driver is not available.')));
926+
->willThrowException($exception);
925927

926-
$this->expectException(RuntimeException::class);
928+
$this->expectException(get_class($exception));
927929

928930
$this->moduleLoader->expects(static::exactly(2))->method('load')->willReturn($allModules);
929931
$setup = $this->createMock(Setup::class);
@@ -1011,6 +1013,14 @@ public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyRuntime
10111013
$this->object->install($request);
10121014
}
10131015

1016+
public function installWithInvalidRemoteStorageConfigurationWithEarlyExceptionDataProvider()
1017+
{
1018+
return [
1019+
[new RuntimeException(__('Remote driver is not available.'))],
1020+
[new DriverException(__('Bucket and region are required values'))],
1021+
];
1022+
}
1023+
10141024
/**
10151025
* Test for InstallDataFixtures
10161026
*

0 commit comments

Comments
 (0)