File tree 2 files changed +13
-0
lines changed
tests/lib/Files/ObjectStore
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -37,4 +37,8 @@ public function setObjectStore(IObjectStore $objectStore) {
37
37
public function getObjectStore (): IObjectStore {
38
38
return $ this ->objectStore ;
39
39
}
40
+
41
+ public function setValidateWrites (bool $ validate ) {
42
+ $ this ->validateWrites = $ validate ;
43
+ }
40
44
}
Original file line number Diff line number Diff line change @@ -181,6 +181,15 @@ public function testWriteObjectSilentFailure() {
181
181
$ this ->assertFalse ($ this ->instance ->file_exists ('test.txt ' ));
182
182
}
183
183
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
+
184
193
public function testDeleteObjectFailureKeepCache () {
185
194
$ objectStore = $ this ->instance ->getObjectStore ();
186
195
$ this ->instance ->setObjectStore (new FailDeleteObjectStore ($ objectStore ));
You can’t perform that action at this time.
0 commit comments