File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88namespace Test \Files \Storage ;
99
10+ use OC \Files \Storage \Wrapper \Jail ;
11+
1012/**
1113 * Class LocalTest
1214 *
@@ -135,4 +137,25 @@ public function testUnavailableNonExternal() {
135137 // no exception thrown
136138 $ this ->assertNotNull ($ this ->instance );
137139 }
140+
141+ public function testMoveNestedJail (): void {
142+ $ this ->instance ->mkdir ('foo ' );
143+ $ this ->instance ->mkdir ('foo/bar ' );
144+ $ this ->instance ->mkdir ('target ' );
145+ $ this ->instance ->file_put_contents ('foo/bar/file.txt ' , 'foo ' );
146+ $ jail1 = new Jail ([
147+ 'storage ' => $ this ->instance ,
148+ 'root ' => 'foo '
149+ ]);
150+ $ jail2 = new Jail ([
151+ 'storage ' => $ jail1 ,
152+ 'root ' => 'bar '
153+ ]);
154+ $ jail3 = new Jail ([
155+ 'storage ' => $ this ->instance ,
156+ 'root ' => 'target '
157+ ]);
158+ $ jail3 ->moveFromStorage ($ jail2 , 'file.txt ' , 'file.txt ' );
159+ $ this ->assertTrue ($ this ->instance ->file_exists ('target/file.txt ' ));
160+ }
138161}
You can’t perform that action at this time.
0 commit comments