Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test disabling write check
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and skjnldsv committed Oct 26, 2022
commit 3357c8e78302a14d9f70b0b74ff5d3d143a03315
4 changes: 4 additions & 0 deletions tests/lib/Files/ObjectStore/ObjectStoreStorageOverwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ public function setObjectStore(IObjectStore $objectStore) {
public function getObjectStore(): IObjectStore {
return $this->objectStore;
}

public function setValidateWrites(bool $validate) {
$this->validateWrites = $validate;
}
}
9 changes: 9 additions & 0 deletions tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down