File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
src/Tempest/Storage/tests Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,33 @@ public function test_storage_read(): void
5555 $ this ->assertSame ('baz ' , $ storage ->read ('foo.txt ' ));
5656 }
5757
58+ public function test_storage_list (): void
59+ {
60+ mkdir ($ this ->fixtures );
61+ file_put_contents ($ this ->fixtures . 'foo.txt ' , 'baz ' );
62+
63+ $ storage = new GenericStorage (new LocalStorageConfig (
64+ path: $ this ->fixtures ,
65+ ));
66+
67+ $ this ->assertCount (1 , $ storage ->list ()->toArray ());
68+ }
69+
70+ public function test_storage_list_deep (): void
71+ {
72+ mkdir ($ this ->fixtures );
73+ file_put_contents ($ this ->fixtures . 'foo.txt ' , 'baz ' );
74+ mkdir ($ this ->fixtures . 'dir ' );
75+ file_put_contents ($ this ->fixtures . 'dir/baz.txt ' , 'bar ' );
76+
77+ $ storage = new GenericStorage (new LocalStorageConfig (
78+ path: $ this ->fixtures ,
79+ ));
80+
81+ $ this ->assertCount (3 , $ storage ->list (deep: true )->toArray ());
82+ $ this ->assertCount (1 , $ storage ->list (location: 'dir ' )->toArray ());
83+ }
84+
5885 public function test_storage_clean_directory (): void
5986 {
6087 mkdir ($ this ->fixtures );
You can’t perform that action at this time.
0 commit comments