Added fallback store feature

This commit is contained in:
lukas committed 2026-10-18 16:46:17 +00:00
1 parent b3c810473f
commit d3741e03ba
5 files changed
+408 -13

No files matched your search

@@ -0,0 +1,29 @@
<?php
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
namespace CloudObjects\SDK;
use CloudObjects\SDK\Exceptions\InvalidSDKConfigurationException;
class ObjectRetrieverTest extends \PHPUnit\Framework\TestCase {
public function testFallbackStoreWithExistingDirectory() {
$retriever = new ObjectRetriever([
'fallback_store_directory' => sys_get_temp_dir(),
'fallback_store_scope' => '*',
]);
$this->assertInstanceOf(ObjectRetriever::class, $retriever);
}
public function testFallbackStoreWithMissingDirectory() {
$this->expectException(InvalidSDKConfigurationException::class);
new ObjectRetriever([
'fallback_store_directory' => sys_get_temp_dir().'/does-not-exist-'.uniqid(),
'fallback_store_scope' => '*',
]);
}
}