Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit 48f9cb2

Browse files
authored
Update test to show on issue in code (#752)
* Update test to show on issue in code This commit updates the test for S3FilesystemV1 to point out a issue in how the code works when trying to access a url for a S3 object using the Filesystem adapter in Laravel. I have code like this Storage::disk('public')->url($filename); where the disk public is configured with: 'driver' => 'async-aws-s3', The issue that I see is that \AsyncAws\Illuminate\Filesystem\AsyncAwsFilesystemAdapter::url is accessing the S3FilesystemV1 and trying to call getClient on it which does not exists in the version required by this (0.3.3). It is added and tagged in 0.4.0. * Fix issue with missing S3FilesystemV1 getClient Require version ^0.4.0 of async-aws/flysystem-s3 to get a version where \AsyncAws\Flysystem\S3\S3FilesystemV1::getClient exist. This is used in \AsyncAws\Illuminate\Filesystem\AsyncAwsFilesystemAdapter::url
1 parent 0ad5578 commit 48f9cb2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^7.2.5 || ^8.0",
1414
"ext-json": "*",
1515
"async-aws/core": "^1.0",
16-
"async-aws/flysystem-s3": "^0.3.3",
16+
"async-aws/flysystem-s3": "^0.4.0",
1717
"async-aws/simple-s3": "^0.1",
1818
"illuminate/filesystem": "^6.18.13 || ^7.10",
1919
"illuminate/support": "^6.18.13 || ^7.10"

tests/Unit/ServiceProviderTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ public function testCreateFilesystem()
4343
self::assertEquals('my_bucket', $bucket);
4444

4545
// Verify config
46-
$property = $refl->getProperty('client');
47-
$property->setAccessible(true);
48-
$client = $property->getValue($s3FilesystemAdapter);
46+
$client = $s3FilesystemAdapter->getClient();
4947

5048
$config = $client->getConfiguration();
5149
self::assertEquals('my_key', $config->get('accessKeyId'));

0 commit comments

Comments
 (0)