|
38 | 38 | use Magento\Framework\Setup\SampleData\State;
|
39 | 39 | use Magento\Framework\Setup\SchemaListener;
|
40 | 40 | use Magento\Framework\Validation\ValidationException;
|
| 41 | + use Magento\RemoteStorage\Driver\DriverException; |
41 | 42 | use Magento\Setup\Controller\ResponseTypeInterface;
|
42 | 43 | use Magento\Setup\Model\AdminAccount;
|
43 | 44 | use Magento\Setup\Model\AdminAccountFactory;
|
@@ -889,11 +890,12 @@ public function testInstallWithUnresolvableRemoteStorageValidator()
|
889 | 890 | * Test installation with invalid remote storage configuration is able to be caught earlier than
|
890 | 891 | * the queued validation step if necessary, and that configuration is reverted back to local file driver.
|
891 | 892 | *
|
| 893 | + * @dataProvider installWithInvalidRemoteStorageConfigurationWithEarlyExceptionDataProvider |
892 | 894 | * @throws \Magento\Framework\Exception\FileSystemException
|
893 | 895 | * @throws \Magento\Framework\Exception\LocalizedException
|
894 | 896 | * @throws \Magento\Framework\Exception\RuntimeException
|
895 | 897 | */
|
896 |
| - public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyRuntimeException() |
| 898 | + public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyException(\Exception $exception) |
897 | 899 | {
|
898 | 900 | $request = $this->request;
|
899 | 901 |
|
@@ -921,9 +923,9 @@ public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyRuntime
|
921 | 923 | $this->declarationInstallerMock
|
922 | 924 | ->expects(static::once())
|
923 | 925 | ->method('installSchema')
|
924 |
| - ->willThrowException(new RuntimeException(__('Remote driver is not available.'))); |
| 926 | + ->willThrowException($exception); |
925 | 927 |
|
926 |
| - $this->expectException(RuntimeException::class); |
| 928 | + $this->expectException(get_class($exception)); |
927 | 929 |
|
928 | 930 | $this->moduleLoader->expects(static::exactly(2))->method('load')->willReturn($allModules);
|
929 | 931 | $setup = $this->createMock(Setup::class);
|
@@ -1011,6 +1013,14 @@ public function testInstallWithInvalidRemoteStorageConfigurationWithEarlyRuntime
|
1011 | 1013 | $this->object->install($request);
|
1012 | 1014 | }
|
1013 | 1015 |
|
| 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 | + |
1014 | 1024 | /**
|
1015 | 1025 | * Test for InstallDataFixtures
|
1016 | 1026 | *
|
|
0 commit comments