2
2
3
3
namespace MongoDB \Tests \GridFS ;
4
4
5
- use MongoDB \GridFS ;
5
+ use MongoDB \GridFS \ Bucket ;
6
6
7
7
/**
8
8
* Functional tests for the Bucket class.
@@ -16,15 +16,20 @@ class BucketFunctionalTest extends FunctionalTestCase
16
16
*/
17
17
public function testConstructorOptionTypeChecks (array $ options )
18
18
{
19
- new \ MongoDB \ GridFS \ Bucket ($ this ->manager , $ this ->getDatabaseName (), $ options );
19
+ new Bucket ($ this ->manager , $ this ->getDatabaseName (), $ options );
20
20
}
21
21
22
22
public function provideInvalidConstructorOptions ()
23
23
{
24
24
$ options = [];
25
- $ invalidBucketNames = [123 , 3.14 , true , [], new \stdClass ];
26
- $ invalidChunkSizes = ['foo ' , 3.14 , true , [], new \stdClass ];
27
25
26
+ foreach ($ this ->getInvalidStringValues () as $ value ) {
27
+ $ options [][] = ['bucketName ' => $ value ];
28
+ }
29
+
30
+ foreach ($ this ->getInvalidIntegerValues () as $ value ) {
31
+ $ options [][] = ['chunkSizeBytes ' => $ value ];
32
+ }
28
33
29
34
foreach ($ this ->getInvalidReadPreferenceValues () as $ value ) {
30
35
$ options [][] = ['readPreference ' => $ value ];
@@ -33,12 +38,6 @@ public function provideInvalidConstructorOptions()
33
38
foreach ($ this ->getInvalidWriteConcernValues () as $ value ) {
34
39
$ options [][] = ['writeConcern ' => $ value ];
35
40
}
36
- foreach ($ invalidBucketNames as $ value ) {
37
- $ options [][] = ['bucketName ' => $ value ];
38
- }
39
- foreach ($ invalidChunkSizes as $ value ) {
40
- $ options [][] = ['chunkSizeBytes ' => $ value ];
41
- }
42
41
43
42
return $ options ;
44
43
}
0 commit comments