@@ -53,6 +53,32 @@ public function provideFilesystems()
5353 * @dataProvider provideFilesystems
5454 */
5555 public function testFileystems (string $ fsName )
56+ {
57+ $ kernel = $ this ->createFysystemKernel ();
58+ $ fs = $ kernel ->getContainer ()->get ('flysystem.test. ' .$ fsName );
59+
60+ $ this ->assertInstanceOf (FilesystemInterface::class, $ fs , 'Filesystem " ' .$ fsName .'" should be an instance of FilesystemInterface ' );
61+ $ this ->assertEquals ('plugin ' , $ fs ->pluginTest ());
62+ }
63+
64+ /**
65+ * @dataProvider provideFilesystems
66+ */
67+ public function testTaggedCollection (string $ fsName )
68+ {
69+ $ kernel = $ this ->createFysystemKernel ();
70+
71+ if (!$ kernel ->getContainer ()->has ('storages_tagged_collection ' )) {
72+ $ this ->markTestSkipped ('Symfony 4.3+ is required to use indexed tagged service collections ' );
73+ }
74+
75+ $ storages = iterator_to_array ($ kernel ->getContainer ()->get ('storages_tagged_collection ' )->locator );
76+
77+ $ this ->assertInstanceOf (FilesystemInterface::class, $ storages [$ fsName ]);
78+ $ this ->assertEquals ('plugin ' , $ storages [$ fsName ]->pluginTest ());
79+ }
80+
81+ private function createFysystemKernel ()
5682 {
5783 (new Dotenv ())->populate ([
5884 'AWS_BUCKET ' => 'bucket-name ' ,
@@ -69,9 +95,7 @@ public function testFileystems(string $fsName)
6995 $ container ->set ($ service , $ mock );
7096 }
7197
72- $ fs = $ container ->get ('flysystem.test. ' .$ fsName );
73- $ this ->assertInstanceOf (FilesystemInterface::class, $ fs , 'Filesystem " ' .$ fsName .'" should be an instance of FilesystemInterface ' );
74- $ this ->assertEquals ('plugin ' , $ fs ->pluginTest ());
98+ return $ kernel ;
7599 }
76100
77101 private function getClientMocks ()
0 commit comments