Skip to content

Commit

Permalink
test disabling write check
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 authored and skjnldsv committed Oct 26, 2022
1 parent a5036a9 commit 3357c8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
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

0 comments on commit 3357c8e

Please sign in to comment.