File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
namespace Test \Files \Storage ;
9
9
10
+ use OC \Files \Storage \Wrapper \Jail ;
11
+
10
12
/**
11
13
* Class LocalTest
12
14
*
@@ -135,4 +137,25 @@ public function testUnavailableNonExternal() {
135
137
// no exception thrown
136
138
$ this ->assertNotNull ($ this ->instance );
137
139
}
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
+ }
138
161
}
You can’t perform that action at this time.
0 commit comments