Skip to content

Commit 507afb6

Browse files
committed
Readd lazy and custom tests
1 parent 44e0dc4 commit 507afb6

7 files changed

+19
-23
lines changed

docs/3-interacting-with-ftp-and-sftp-servers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ flysystem:
6464
6565
## Next
6666
67-
[Using a lazy adapter to switch storage backend using an environment variable](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/5-using-lazy-adapter-to-switch-at-runtime.md)
67+
[Using a lazy adapter to switch storage backend using an environment variable](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/4-using-lazy-adapter-to-switch-at-runtime.md)

docs/4-using-lazy-adapter-to-switch-at-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ same way as any other storage:
110110

111111
## Next
112112

113-
[Creating a custom adapter](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/6-creating-a-custom-adapter.md)
113+
[Creating a custom adapter](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/5-creating-a-custom-adapter.md)

tests/DependencyInjection/FlysystemExtensionTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use League\Flysystem\FilesystemOperator;
1919
use PHPUnit\Framework\TestCase;
2020
use Symfony\Component\Dotenv\Dotenv;
21-
use Symfony\Component\HttpKernel\Kernel;
2221
use Tests\League\FlysystemBundle\Kernel\FlysystemAppKernel;
2322

2423
class FlysystemExtensionTest extends TestCase
@@ -27,8 +26,10 @@ public function provideFilesystems()
2726
{
2827
$fsNames = [
2928
'fs_aws',
29+
'fs_custom',
3030
'fs_ftp',
3131
'fs_gcloud',
32+
'fs_lazy',
3233
'fs_local',
3334
'fs_sftp',
3435
];
@@ -95,14 +96,9 @@ private function getClientMocks()
9596
$gcloud = $this->createMock(StorageClient::class);
9697
$gcloud->method('bucket')->willReturn($this->createMock(Bucket::class));
9798

98-
$asyncAws = null;
99-
if (Kernel::VERSION_ID > 50200 && class_exists(AsyncS3Client::class)) {
100-
$asyncAws = $this->createMock(AsyncS3Client::class);
101-
}
102-
10399
return [
104100
'aws_client_service' => $this->createMock(S3Client::class),
105-
'asyncaws_client_service' => $asyncAws,
101+
'asyncaws_client_service' => $this->createMock(AsyncS3Client::class),
106102
'gcloud_client_service' => $gcloud,
107103
];
108104
}

tests/Kernel/config/flysystem.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
flysystem:
22
storages:
3+
fs_asyncaws:
4+
adapter: 'asyncaws'
5+
options:
6+
client: 'asyncaws_client_service'
7+
bucket: '%env(AWS_BUCKET)%'
8+
prefix: 'optional/path/prefix'
9+
310
fs_aws:
411
adapter: 'aws'
512
options:
613
client: 'aws_client_service'
714
bucket: '%env(AWS_BUCKET)%'
815
prefix: 'optional/path/prefix'
916

17+
fs_custom:
18+
adapter: 'custom_adapter'
19+
1020
fs_ftp:
1121
adapter: 'ftp'
1222
options:

tests/Kernel/config/flysystem_asyncaws.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/Kernel/config/services.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ services:
33
public: true
44

55
custom_adapter:
6-
class: 'League\Flysystem\Adapter\NullAdapter'
6+
class: 'League\Flysystem\InMemory\InMemoryFilesystemAdapter'
77

88
# Aliases used to test the services construction
9+
flysystem.test.fs_asyncaws: { alias: 'fs_asyncaws' }
910
flysystem.test.fs_aws: { alias: 'fs_aws' }
11+
flysystem.test.fs_custom: { alias: 'fs_custom' }
1012
flysystem.test.fs_ftp: { alias: 'fs_ftp' }
1113
flysystem.test.fs_gcloud: { alias: 'fs_gcloud' }
14+
flysystem.test.fs_lazy: { alias: 'fs_lazy' }
1215
flysystem.test.fs_local: { alias: 'fs_local' }
1316
flysystem.test.fs_memory: { alias: 'fs_memory' }
1417
flysystem.test.fs_sftp: { alias: 'fs_sftp' }

tests/Kernel/config/services_asyncaws.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)