@@ -167,25 +167,29 @@ public function testCanBuildScopedDisksWithVisibility()
167
167
168
168
public function testCanBuildScopedDisksWithThrow ()
169
169
{
170
- $ filesystem = new FilesystemManager (tap (new Application , function ($ app ) {
171
- $ app ['config ' ] = [
172
- 'filesystems.disks.local ' => [
173
- 'driver ' => 'local ' ,
174
- 'root ' => 'to-be-scoped ' ,
175
- 'throw ' => false ,
176
- ],
177
- ];
178
- }));
170
+ try {
171
+ $ filesystem = new FilesystemManager (tap (new Application , function ($ app ) {
172
+ $ app ['config ' ] = [
173
+ 'filesystems.disks.local ' => [
174
+ 'driver ' => 'local ' ,
175
+ 'root ' => 'to-be-scoped ' ,
176
+ 'throw ' => false ,
177
+ ],
178
+ ];
179
+ }));
179
180
180
- $ scoped = $ filesystem ->build ([
181
- 'driver ' => 'scoped ' ,
182
- 'disk ' => 'local ' ,
183
- 'prefix ' => 'path-prefix ' ,
184
- 'throw ' => true ,
185
- ]);
181
+ $ scoped = $ filesystem ->build ([
182
+ 'driver ' => 'scoped ' ,
183
+ 'disk ' => 'local ' ,
184
+ 'prefix ' => 'path-prefix ' ,
185
+ 'throw ' => true ,
186
+ ]);
186
187
187
- $ this ->expectException (UnableToReadFile::class);
188
- $ scoped ->get ('dirname/filename.txt ' );
188
+ $ this ->expectException (UnableToReadFile::class);
189
+ $ scoped ->get ('dirname/filename.txt ' );
190
+ } finally {
191
+ rmdir (__DIR__ .'/../../to-be-scoped ' );
192
+ }
189
193
}
190
194
191
195
public function testCanBuildInlineScopedDisks ()
@@ -215,21 +219,25 @@ public function testCanBuildInlineScopedDisks()
215
219
216
220
public function testKeepTrackOfAdapterDecoration ()
217
221
{
218
- $ filesystem = new FilesystemManager (tap (new Application , function ($ app ) {
219
- $ app ['config ' ] = [
220
- 'filesystems.disks.local ' => [
221
- 'driver ' => 'local ' ,
222
- 'root ' => 'to-be-scoped ' ,
223
- ],
224
- ];
225
- }));
222
+ try {
223
+ $ filesystem = new FilesystemManager (tap (new Application , function ($ app ) {
224
+ $ app ['config ' ] = [
225
+ 'filesystems.disks.local ' => [
226
+ 'driver ' => 'local ' ,
227
+ 'root ' => 'to-be-scoped ' ,
228
+ ],
229
+ ];
230
+ }));
226
231
227
- $ scoped = $ filesystem ->build ([
228
- 'driver ' => 'scoped ' ,
229
- 'disk ' => 'local ' ,
230
- 'prefix ' => 'path-prefix ' ,
231
- ]);
232
+ $ scoped = $ filesystem ->build ([
233
+ 'driver ' => 'scoped ' ,
234
+ 'disk ' => 'local ' ,
235
+ 'prefix ' => 'path-prefix ' ,
236
+ ]);
232
237
233
- $ this ->assertInstanceOf (PathPrefixedAdapter::class, $ scoped ->getAdapter ());
238
+ $ this ->assertInstanceOf (PathPrefixedAdapter::class, $ scoped ->getAdapter ());
239
+ } finally {
240
+ rmdir (__DIR__ .'/../../to-be-scoped ' );
241
+ }
234
242
}
235
243
}
0 commit comments