27
27
$ publicId = 'file-write- ' .rand ();
28
28
$ fakeImage = File::image ('black.jpg ' )->getContent ();
29
29
30
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
30
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
31
31
32
32
assertUploadResponse ($ this , $ this ->adapter ->meta , $ publicId );
33
33
$ this ->adapter ->delete ($ publicId ); // cleanup
37
37
$ publicId = 'file-write-stream- ' .rand ();
38
38
$ fakeImage = File::image ('black.jpg ' )->getContent ();
39
39
40
- $ this ->adapter ->writeStream ($ publicId , $ fakeImage , new Config () );
40
+ $ this ->adapter ->writeStream ($ publicId , $ fakeImage , new Config );
41
41
42
42
assertUploadResponse ($ this , $ this ->adapter ->meta , $ publicId );
43
43
$ this ->adapter ->delete ($ publicId ); // cleanup
47
47
$ publicId = 'file-update- ' .rand ();
48
48
$ fakeImage = File::image ('black.jpg ' )->getContent ();
49
49
50
- $ meta = $ this ->adapter ->update ($ publicId , $ fakeImage , new Config () );
50
+ $ meta = $ this ->adapter ->update ($ publicId , $ fakeImage , new Config );
51
51
52
52
assertUploadResponse ($ this , $ meta , $ publicId );
53
53
$ this ->adapter ->delete ($ publicId ); // cleanup
57
57
$ publicId = 'file-update-stream- ' .rand ();
58
58
$ fakeImage = File::image ('black.jpg ' )->getContent ();
59
59
60
- $ meta = $ this ->adapter ->updateStream ($ publicId , $ fakeImage , new Config () );
60
+ $ meta = $ this ->adapter ->updateStream ($ publicId , $ fakeImage , new Config );
61
61
62
62
assertUploadResponse ($ this , $ meta , $ publicId );
63
63
$ this ->adapter ->delete ($ publicId ); // cleanup
@@ -81,7 +81,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
81
81
$ path = 'file-old-path- ' .rand ();
82
82
$ newPath = 'file-new-path- ' .rand ();
83
83
$ fakeImage = File::image ('black.jpg ' )->getContent ();
84
- $ this ->adapter ->write ($ path , $ fakeImage , new Config () );
84
+ $ this ->adapter ->write ($ path , $ fakeImage , new Config );
85
85
86
86
$ bool = $ this ->adapter ->rename ($ path , $ newPath );
87
87
@@ -102,8 +102,8 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
102
102
$ path = 'file-rename- ' .rand ();
103
103
$ newPath = 'file-already-exists- ' .rand ();
104
104
$ fakeImage = File::image ('black.jpg ' )->getContent ();
105
- $ this ->adapter ->write ($ path , $ fakeImage , new Config () );
106
- $ this ->adapter ->write ($ newPath , $ fakeImage , new Config () );
105
+ $ this ->adapter ->write ($ path , $ fakeImage , new Config );
106
+ $ this ->adapter ->write ($ newPath , $ fakeImage , new Config );
107
107
108
108
$ bool = $ this ->adapter ->rename ($ path , $ newPath );
109
109
@@ -116,9 +116,9 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
116
116
$ path = 'file-old-copy- ' .rand ();
117
117
$ newPath = 'file-new-copy- ' .rand ();
118
118
$ fakeImage = File::image ('black.jpg ' )->getContent ();
119
- $ this ->adapter ->write ($ path , $ fakeImage , new Config () );
119
+ $ this ->adapter ->write ($ path , $ fakeImage , new Config );
120
120
121
- $ this ->adapter ->copy ($ path , $ newPath , new Config () );
121
+ $ this ->adapter ->copy ($ path , $ newPath , new Config );
122
122
123
123
$ this ->assertTrue ($ this ->adapter ->fileExists ($ newPath ));
124
124
$ this ->adapter ->delete ($ path ); // cleanup
@@ -129,15 +129,15 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
129
129
$ path = 'file-does-not-exist ' ;
130
130
$ newPath = 'file-copied ' ;
131
131
132
- $ this ->adapter ->copy ($ path , $ newPath , new Config () );
132
+ $ this ->adapter ->copy ($ path , $ newPath , new Config );
133
133
134
134
$ this ->assertFalse ($ this ->adapter ->copied );
135
135
});
136
136
137
137
it ('can delete ' , function () {
138
138
$ publicId = 'file-delete- ' .rand ();
139
139
$ fakeImage = File::image ('black.jpg ' )->getContent ();
140
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
140
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
141
141
142
142
$ this ->adapter ->delete ($ publicId );
143
143
@@ -147,7 +147,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
147
147
it ('can delete a directory ' , function () {
148
148
$ publicId = 'delete_dir/file- ' .rand ();
149
149
$ fakeImage = File::image ('black.jpg ' )->getContent ();
150
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
150
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
151
151
152
152
$ bool = $ this ->adapter ->deleteDir ('delete_dir ' );
153
153
@@ -157,7 +157,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
157
157
it ('can create a directory ' , function () {
158
158
$ directory = 'directory- ' .rand ();
159
159
160
- $ meta = $ this ->adapter ->createDir ($ directory , new Config () );
160
+ $ meta = $ this ->adapter ->createDir ($ directory , new Config );
161
161
162
162
$ this ->assertSame ([
163
163
'path ' => $ directory ,
@@ -169,7 +169,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
169
169
it ('can check if file exists ' , function () {
170
170
$ publicId = 'file-has- ' .rand ();
171
171
$ fakeImage = File::image ('black.jpg ' )->getContent ();
172
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
172
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
173
173
174
174
$ bool = $ this ->adapter ->has ($ publicId );
175
175
@@ -188,7 +188,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
188
188
it ('can read ' , function () {
189
189
$ publicId = 'file-read- ' .rand ();
190
190
$ fakeImage = File::image ('black.jpg ' )->getContent ();
191
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
191
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
192
192
193
193
$ content = $ this ->adapter ->read ($ publicId );
194
194
@@ -199,7 +199,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
199
199
it ('can read stream ' , function () {
200
200
$ publicId = 'file-read-stream- ' .rand ();
201
201
$ fakeImage = File::image ('black.jpg ' )->getContent ();
202
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
202
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
203
203
204
204
$ meta = $ this ->adapter ->readStream ($ publicId );
205
205
@@ -233,7 +233,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
233
233
it ('does get size ' , function () {
234
234
$ publicId = 'file-get-size- ' .rand ();
235
235
$ fakeImage = File::image ('black.jpg ' )->getContent ();
236
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
236
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
237
237
238
238
$ size = $ this ->adapter ->getSize ($ publicId );
239
239
@@ -251,7 +251,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
251
251
it ('does get mimetype ' , function () {
252
252
$ publicId = 'file-get-mimetype- ' .rand ();
253
253
$ fakeImage = File::image ('black.jpg ' )->getContent ();
254
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
254
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
255
255
256
256
$ mimeType = $ this ->adapter ->getMimetype ($ publicId );
257
257
@@ -269,7 +269,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
269
269
it ('does get timestamp ' , function () {
270
270
$ publicId = 'file-get-mimetype- ' .rand ();
271
271
$ fakeImage = File::image ('black.jpg ' )->getContent ();
272
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
272
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
273
273
274
274
$ timeStamp = $ this ->adapter ->getTimestamp ($ publicId );
275
275
@@ -287,7 +287,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
287
287
it ('does get visibility ' , function () {
288
288
$ publicId = 'file-get-mimetype- ' .rand ();
289
289
$ fakeImage = File::image ('black.jpg ' )->getContent ();
290
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
290
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
291
291
292
292
$ visibility = $ this ->adapter ->getVisibility ($ publicId );
293
293
@@ -305,7 +305,7 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
305
305
it ('does get url ' , function () {
306
306
$ publicId = 'file-get-url- ' .rand ();
307
307
$ fakeImage = File::image ('black.jpg ' )->getContent ();
308
- $ this ->adapter ->write ($ publicId , $ fakeImage , new Config () );
308
+ $ this ->adapter ->write ($ publicId , $ fakeImage , new Config );
309
309
310
310
$ url = $ this ->adapter ->getUrl ($ publicId );
311
311
@@ -321,8 +321,8 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
321
321
322
322
$ this ->assertFalse ($ this ->adapter ->fileExists ($ movedToId ));
323
323
324
- $ this ->adapter ->write ($ sourceId , $ source , new Config () );
325
- $ this ->adapter ->move ($ sourceId , $ movedToId , new Config () );
324
+ $ this ->adapter ->write ($ sourceId , $ source , new Config );
325
+ $ this ->adapter ->move ($ sourceId , $ movedToId , new Config );
326
326
327
327
$ this ->assertFalse ($ this ->adapter ->fileExists ($ sourceId ));
328
328
$ this ->assertTrue ($ this ->adapter ->fileExists ($ movedToId ));
@@ -334,12 +334,12 @@ function assertUploadResponse(mixed $test, array $meta, string $publicId): void
334
334
335
335
$ this ->assertFalse ($ this ->adapter ->fileExists ($ sourceId ));
336
336
$ this ->expectException (UnableToMoveFile::class);
337
- $ this ->adapter ->move ($ sourceId , $ movedToId , new Config () );
337
+ $ this ->adapter ->move ($ sourceId , $ movedToId , new Config );
338
338
});
339
339
340
340
it ('can create and delete directory ' , function () {
341
341
$ directory = 'directory_to_create ' ;
342
- $ this ->adapter ->createDirectory ($ directory , new Config () );
342
+ $ this ->adapter ->createDirectory ($ directory , new Config );
343
343
344
344
$ this ->assertTrue ($ this ->adapter ->directoryExists ($ directory ));
345
345
0 commit comments