File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
src/Illuminate/Filesystem Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,10 @@ function (&$parent) use ($config) {
313
313
if (isset ($ config ['visibility ' ])) {
314
314
$ parent ['visibility ' ] = $ config ['visibility ' ];
315
315
}
316
+
317
+ if (isset ($ config ['throw ' ])) {
318
+ $ parent ['throw ' ] = $ config ['throw ' ];
319
+ }
316
320
}
317
321
));
318
322
}
Original file line number Diff line number Diff line change 6
6
use Illuminate \Filesystem \FilesystemManager ;
7
7
use Illuminate \Foundation \Application ;
8
8
use InvalidArgumentException ;
9
+ use League \Flysystem \UnableToReadFile ;
9
10
use PHPUnit \Framework \Attributes \RequiresOperatingSystem ;
10
11
use PHPUnit \Framework \TestCase ;
11
12
@@ -163,6 +164,29 @@ public function testCanBuildScopedDisksWithVisibility()
163
164
}
164
165
}
165
166
167
+ public function testCanBuildScopedDisksWithThrow ()
168
+ {
169
+ $ filesystem = new FilesystemManager (tap (new Application , function ($ app ) {
170
+ $ app ['config ' ] = [
171
+ 'filesystems.disks.local ' => [
172
+ 'driver ' => 'local ' ,
173
+ 'root ' => 'to-be-scoped ' ,
174
+ 'throw ' => false ,
175
+ ],
176
+ ];
177
+ }));
178
+
179
+ $ scoped = $ filesystem ->build ([
180
+ 'driver ' => 'scoped ' ,
181
+ 'disk ' => 'local ' ,
182
+ 'prefix ' => 'path-prefix ' ,
183
+ 'throw ' => true ,
184
+ ]);
185
+
186
+ $ this ->expectException (UnableToReadFile::class);
187
+ $ scoped ->get ('dirname/filename.txt ' );
188
+ }
189
+
166
190
public function testCanBuildInlineScopedDisks ()
167
191
{
168
192
try {
You can’t perform that action at this time.
0 commit comments