Skip to content

Commit d4fcb7b

Browse files
committed
[BUGFIX] Test if a storage is offline to prevent infinite loops in UniqueStorageTargetTest
1 parent fd11ad2 commit d4fcb7b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Classes/Domain/Driver/RemoteFileAbstractionLayerDriver.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ public function initialize()
135135
}
136136
}
137137

138+
/**
139+
* @return bool
140+
*/
141+
public function isOnline()
142+
{
143+
return true === (bool)$this->remoteDriverSettings['is_online'];
144+
}
145+
138146
/**
139147
* @return bool
140148
*/

Classes/Testing/Tests/Fal/UniqueStorageTargetTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public function run()
7070

7171
foreach ($keys as $key) {
7272
$storageObject = $resourceFactory->getStorageObject($key, $storages['local'][$key]);
73+
if (!$storageObject->isOnline()) {
74+
continue;
75+
}
7376
$driverProperty = new PropertyReflection(get_class($storageObject), 'driver');
7477
$driverProperty->setAccessible(true);
7578
/** @var DriverInterface $localDriver */
@@ -78,6 +81,9 @@ public function run()
7881
$foreignDriver = new RemoteFileAbstractionLayerDriver();
7982
$foreignDriver->setStorageUid($storages['foreign'][$key]['uid']);
8083
$foreignDriver->initialize();
84+
if (!$foreignDriver->isOnline()) {
85+
continue;
86+
}
8187

8288
do {
8389
$uniqueFile = uniqid('tx_in2publish_testfile');

0 commit comments

Comments
 (0)