diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStorageOverwrite.php b/tests/lib/Files/ObjectStore/ObjectStoreStorageOverwrite.php index 5872056e42d25..b85f6289c9485 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreStorageOverwrite.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageOverwrite.php @@ -37,4 +37,8 @@ public function setObjectStore(IObjectStore $objectStore) { public function getObjectStore(): IObjectStore { return $this->objectStore; } + + public function setValidateWrites(bool $validate) { + $this->validateWrites = $validate; + } } diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php index 5ebfd48d1a62b..1bebaf6c4ba7b 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php @@ -181,6 +181,15 @@ public function testWriteObjectSilentFailure() { $this->assertFalse($this->instance->file_exists('test.txt')); } + public function testWriteObjectSilentFailureNoCheck() { + $objectStore = $this->instance->getObjectStore(); + $this->instance->setObjectStore(new FailWriteObjectStore($objectStore)); + $this->instance->setValidateWrites(false); + + $this->instance->file_put_contents('test.txt', 'foo'); + $this->assertTrue($this->instance->file_exists('test.txt')); + } + public function testDeleteObjectFailureKeepCache() { $objectStore = $this->instance->getObjectStore(); $this->instance->setObjectStore(new FailDeleteObjectStore($objectStore));