19
19
20
20
class AzureBlobStorageSpec extends ObjectBehavior
21
21
{
22
- public function let (BlobProxyFactoryInterface $ blobFactory )
22
+ function let (BlobProxyFactoryInterface $ blobFactory )
23
23
{
24
24
$ this ->beConstructedWith ($ blobFactory , 'containerName ' );
25
25
}
26
26
27
- public function it_should_be_initializable ()
27
+ function it_should_be_initializable ()
28
28
{
29
29
$ this ->shouldHaveType ('Gaufrette\Adapter\AzureBlobStorage ' );
30
30
$ this ->shouldHaveType ('Gaufrette\Adapter ' );
31
31
$ this ->shouldHaveType ('Gaufrette\Adapter\MetadataSupporter ' );
32
32
}
33
33
34
- public function it_reads_file (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob , GetBlobResult $ blobContent )
34
+ function it_reads_file (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob , GetBlobResult $ blobContent )
35
35
{
36
36
$ blobFactory ->create ()->willReturn ($ blob );
37
37
38
38
$ blob ->getBlob ('containerName ' , 'filename ' )->willReturn ($ blobContent );
39
39
$ blobContent
40
40
->getContentStream ()
41
41
//azure blob content is handled as stream so we need to fake it
42
- ->willReturn (fopen ('data://text/plain,some content ' ,'r ' ))
42
+ ->willReturn (fopen ('data://text/plain,some content ' , 'r ' ))
43
43
;
44
44
45
45
$ this ->read ('filename ' )->shouldReturn ('some content ' );
46
46
}
47
47
48
- public function it_throws_storage_failure_if_it_fails_to_read_file (
48
+ function it_throws_storage_failure_if_it_fails_to_read_file (
49
49
BlobProxyFactoryInterface $ blobFactory ,
50
50
IBlob $ blob ,
51
51
ServiceException $ azureException ,
@@ -60,7 +60,7 @@ public function it_throws_storage_failure_if_it_fails_to_read_file(
60
60
$ this ->shouldThrow (StorageFailure::class)->duringRead ('filename ' );
61
61
}
62
62
63
- public function it_throws_file_not_found_if_read_file_does_not_exist (
63
+ function it_throws_file_not_found_if_read_file_does_not_exist (
64
64
BlobProxyFactoryInterface $ blobFactory ,
65
65
IBlob $ blob ,
66
66
ServiceException $ azureException ,
@@ -75,7 +75,7 @@ public function it_throws_file_not_found_if_read_file_does_not_exist(
75
75
$ this ->shouldThrow (FileNotFound::class)->duringRead ('filename ' );
76
76
}
77
77
78
- public function it_renames_file (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob )
78
+ function it_renames_file (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob )
79
79
{
80
80
$ blobFactory ->create ()->willReturn ($ blob );
81
81
@@ -85,7 +85,7 @@ public function it_renames_file(BlobProxyFactoryInterface $blobFactory, IBlob $b
85
85
$ this ->shouldNotThrow (\Exception::class)->duringRename ('filename1 ' , 'filename2 ' );
86
86
}
87
87
88
- public function it_throws_storage_failure_when_rename_fail (
88
+ function it_throws_storage_failure_when_rename_fail (
89
89
BlobProxyFactoryInterface $ blobFactory ,
90
90
IBlob $ blob ,
91
91
ServiceException $ azureException ,
@@ -103,7 +103,7 @@ public function it_throws_storage_failure_when_rename_fail(
103
103
$ this ->shouldThrow (StorageFailure::class)->duringRename ('filename1 ' , 'filename2 ' );
104
104
}
105
105
106
- public function it_throws_file_not_found_when_renamed_file_does_not_exist (
106
+ function it_throws_file_not_found_when_renamed_file_does_not_exist (
107
107
BlobProxyFactoryInterface $ blobFactory ,
108
108
IBlob $ blob ,
109
109
ServiceException $ azureException ,
@@ -121,7 +121,7 @@ public function it_throws_file_not_found_when_renamed_file_does_not_exist(
121
121
$ this ->shouldThrow (FileNotFound::class)->duringRename ('filename1 ' , 'filename2 ' );
122
122
}
123
123
124
- public function it_writes_file (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob )
124
+ function it_writes_file (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob )
125
125
{
126
126
$ blobFactory ->create ()->willReturn ($ blob );
127
127
@@ -133,7 +133,7 @@ public function it_writes_file(BlobProxyFactoryInterface $blobFactory, IBlob $bl
133
133
$ this ->shouldNotThrow (StorageFailure::class)->duringWrite ('filename ' , 'some content ' );
134
134
}
135
135
136
- public function it_throws_storage_failure_when_write_fail (
136
+ function it_throws_storage_failure_when_write_fail (
137
137
BlobProxyFactoryInterface $ blobFactory ,
138
138
IBlob $ blob ,
139
139
ServiceException $ azureException ,
@@ -150,7 +150,7 @@ public function it_throws_storage_failure_when_write_fail(
150
150
$ this ->shouldThrow (StorageFailure::class)->duringWrite ('filename ' , 'some content ' );
151
151
}
152
152
153
- public function it_checks_if_file_exists (
153
+ function it_checks_if_file_exists (
154
154
BlobProxyFactoryInterface $ blobFactory ,
155
155
IBlob $ blob ,
156
156
GetBlobResult $ blobContent ,
@@ -168,7 +168,7 @@ public function it_checks_if_file_exists(
168
168
$ this ->exists ('filename2 ' )->shouldReturn (true );
169
169
}
170
170
171
- public function it_throws_storage_failure_when_it_fails_to_assert_if_a_file_exists (
171
+ function it_throws_storage_failure_when_it_fails_to_assert_if_a_file_exists (
172
172
BlobProxyFactoryInterface $ blobFactory ,
173
173
IBlob $ blob ,
174
174
ServiceException $ azureException ,
@@ -186,7 +186,7 @@ public function it_throws_storage_failure_when_it_fails_to_assert_if_a_file_exis
186
186
$ this ->shouldThrow (StorageFailure::class)->duringExists ('filename ' );
187
187
}
188
188
189
- public function it_gets_file_mtime (
189
+ function it_gets_file_mtime (
190
190
BlobProxyFactoryInterface $ blobFactory ,
191
191
IBlob $ blob ,
192
192
GetBlobPropertiesResult $ blobPropertiesResult ,
@@ -201,7 +201,7 @@ public function it_gets_file_mtime(
201
201
$ this ->mtime ('filename ' )->shouldReturn (strtotime ('1987-12-28 20:00:00 ' ));
202
202
}
203
203
204
- public function it_throws_storage_failure_when_it_fails_to_get_file_mtime (
204
+ function it_throws_storage_failure_when_it_fails_to_get_file_mtime (
205
205
BlobProxyFactoryInterface $ blobFactory ,
206
206
IBlob $ blob ,
207
207
ServiceException $ azureException ,
@@ -216,7 +216,7 @@ public function it_throws_storage_failure_when_it_fails_to_get_file_mtime(
216
216
$ this ->shouldThrow (StorageFailure::class)->duringMtime ('filename ' );
217
217
}
218
218
219
- public function it_throws_file_not_found_when_it_fails_to_get_file_mtime (
219
+ function it_throws_file_not_found_when_it_fails_to_get_file_mtime (
220
220
BlobProxyFactoryInterface $ blobFactory ,
221
221
IBlob $ blob ,
222
222
ServiceException $ azureException ,
@@ -231,7 +231,7 @@ public function it_throws_file_not_found_when_it_fails_to_get_file_mtime(
231
231
$ this ->shouldThrow (FileNotFound::class)->duringMtime ('filename ' );
232
232
}
233
233
234
- public function it_deletes_file (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob )
234
+ function it_deletes_file (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob )
235
235
{
236
236
$ blobFactory ->create ()->willReturn ($ blob );
237
237
@@ -240,7 +240,7 @@ public function it_deletes_file(BlobProxyFactoryInterface $blobFactory, IBlob $b
240
240
$ this ->shouldNotThrow (StorageFailure::class)->duringDelete ('filename ' );
241
241
}
242
242
243
- public function it_throws_storage_failure_when_it_fails_to_delete_file (
243
+ function it_throws_storage_failure_when_it_fails_to_delete_file (
244
244
BlobProxyFactoryInterface $ blobFactory ,
245
245
IBlob $ blob ,
246
246
ServiceException $ azureException ,
@@ -255,7 +255,7 @@ public function it_throws_storage_failure_when_it_fails_to_delete_file(
255
255
$ this ->shouldThrow (StorageFailure::class)->duringDelete ('filename ' );
256
256
}
257
257
258
- public function it_throws_file_not_found_when_it_fails_to_delete_file (
258
+ function it_throws_file_not_found_when_it_fails_to_delete_file (
259
259
BlobProxyFactoryInterface $ blobFactory ,
260
260
IBlob $ blob ,
261
261
ServiceException $ azureException ,
@@ -270,7 +270,7 @@ public function it_throws_file_not_found_when_it_fails_to_delete_file(
270
270
$ this ->shouldThrow (FileNotFound::class)->duringDelete ('filename ' );
271
271
}
272
272
273
- public function it_should_get_keys (
273
+ function it_should_get_keys (
274
274
BlobProxyFactoryInterface $ blobFactory ,
275
275
IBlob $ blob ,
276
276
Blob $ blobFooBar ,
@@ -288,7 +288,7 @@ public function it_should_get_keys(
288
288
$ this ->keys ()->shouldReturn (['foo/bar ' , 'baz ' ]);
289
289
}
290
290
291
- public function it_throws_storage_failure_when_it_fails_to_get_keys (
291
+ function it_throws_storage_failure_when_it_fails_to_get_keys (
292
292
BlobProxyFactoryInterface $ blobFactory ,
293
293
IBlob $ blob ,
294
294
ServiceException $ azureException ,
@@ -303,7 +303,7 @@ public function it_throws_storage_failure_when_it_fails_to_get_keys(
303
303
$ this ->shouldThrow (StorageFailure::class)->duringKeys ();
304
304
}
305
305
306
- public function it_creates_container (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob )
306
+ function it_creates_container (BlobProxyFactoryInterface $ blobFactory , IBlob $ blob )
307
307
{
308
308
$ blobFactory ->create ()->willReturn ($ blob );
309
309
@@ -312,7 +312,7 @@ public function it_creates_container(BlobProxyFactoryInterface $blobFactory, IBl
312
312
$ this ->createContainer ('containerName ' );
313
313
}
314
314
315
- public function it_throws_storage_failure_when_it_fails_to_create_container (
315
+ function it_throws_storage_failure_when_it_fails_to_create_container (
316
316
BlobProxyFactoryInterface $ blobFactory ,
317
317
IBlob $ blob ,
318
318
ServiceException $ azureException ,
0 commit comments