Skip to content

Commit

Permalink
Add functional test for async-aws
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalopin committed Apr 4, 2020
1 parent 9205bc7 commit d485109
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
7 changes: 1 addition & 6 deletions src/Adapter/Builder/AbstractAdapterDefinitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ private function ensureRequiredPackagesAvailable()
return;
}

throw new MissingPackageException(sprintf(
"Missing package%s, to use the \"%s\" adapter, run:\n\ncomposer require %s",
\count($missingPackages) > 1 ? 's' : '',
$this->getName(),
implode(' ', $missingPackages)
));
throw new MissingPackageException(sprintf("Missing package%s, to use the \"%s\" adapter, run:\n\ncomposer require %s", \count($missingPackages) > 1 ? 's' : '', $this->getName(), implode(' ', $missingPackages)));
}
}
4 changes: 0 additions & 4 deletions src/Adapter/Builder/AdapterDefinitionBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ public function getName(): string;

/**
* Create the definition for this builder's adapter given an array of options.
*
* @param array $options
*
* @return Definition
*/
public function createDefinition(array $options): Definition;
}
3 changes: 3 additions & 0 deletions tests/DependencyInjection/FlysystemExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Tests\League\FlysystemBundle\DependencyInjection;

use AsyncAws\S3\S3Client as AsyncS3Client;
use Aws\S3\S3Client;
use Google\Cloud\Storage\Bucket;
use Google\Cloud\Storage\StorageClient;
Expand All @@ -28,6 +29,7 @@ class FlysystemExtensionTest extends TestCase
public function provideFilesystems()
{
$fsNames = [
'fs_asyncaws',
'fs_aws',
'fs_azure',
'fs_cache',
Expand Down Expand Up @@ -105,6 +107,7 @@ private function getClientMocks()

return [
'aws_client_service' => $this->createMock(S3Client::class),
'asyncaws_client_service' => $this->createMock(AsyncS3Client::class),
'azure_client_service' => $this->createMock(BlobRestProxy::class),
'dropbox_client_service' => $this->createMock(DropboxClient::class),
'gcloud_client_service' => $gcloud,
Expand Down
7 changes: 7 additions & 0 deletions tests/Kernel/config/flysystem.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
flysystem:
storages:
fs_asyncaws:
adapter: 'asyncaws'
options:
client: 'asyncaws_client_service'
bucket: '%env(AWS_BUCKET)%'
prefix: 'optional/path/prefix'

fs_aws:
adapter: 'aws'
options:
Expand Down
1 change: 1 addition & 0 deletions tests/Kernel/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
class: 'League\Flysystem\Adapter\NullAdapter'

# Aliases used to test the services construction
flysystem.test.fs_asyncaws: { alias: 'fs_asyncaws' }
flysystem.test.fs_aws: { alias: 'fs_aws' }
flysystem.test.fs_azure: { alias: 'fs_azure' }
flysystem.test.fs_cache: { alias: 'fs_cache' }
Expand Down

0 comments on commit d485109

Please sign in to comment.