Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1ae8129

Browse files
committedAug 4, 2022
test disabling write check
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent de5714a commit 1ae8129

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
 

‎tests/lib/Files/ObjectStore/ObjectStoreStorageOverwrite.php

+4
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,8 @@ public function setObjectStore(IObjectStore $objectStore) {
3737
public function getObjectStore(): IObjectStore {
3838
return $this->objectStore;
3939
}
40+
41+
public function setValidateWrites(bool $validate) {
42+
$this->validateWrites = $validate;
43+
}
4044
}

‎tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php

+9
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ public function testWriteObjectSilentFailure() {
181181
$this->assertFalse($this->instance->file_exists('test.txt'));
182182
}
183183

184+
public function testWriteObjectSilentFailureNoCheck() {
185+
$objectStore = $this->instance->getObjectStore();
186+
$this->instance->setObjectStore(new FailWriteObjectStore($objectStore));
187+
$this->instance->setValidateWrites(false);
188+
189+
$this->instance->file_put_contents('test.txt', 'foo');
190+
$this->assertTrue($this->instance->file_exists('test.txt'));
191+
}
192+
184193
public function testDeleteObjectFailureKeepCache() {
185194
$objectStore = $this->instance->getObjectStore();
186195
$this->instance->setObjectStore(new FailDeleteObjectStore($objectStore));

0 commit comments

Comments
 (0)
Please sign in to comment.