@@ -36,30 +36,18 @@ public function provideInvalidFieldOrderValues()
36
36
return $ this ->wrapValuesForDataProvider ([true , [], new stdClass ()]);
37
37
}
38
38
39
- public function testConstructorShouldRequireNamespace ()
40
- {
41
- $ this ->expectException (InvalidArgumentException::class);
42
- new IndexInput (['key ' => ['x ' => 1 ]]);
43
- }
44
-
45
- public function testConstructorShouldRequireNamespaceToBeString ()
46
- {
47
- $ this ->expectException (InvalidArgumentException::class);
48
- new IndexInput (['key ' => ['x ' => 1 ], 'ns ' => 1 ]);
49
- }
50
-
51
39
public function testConstructorShouldRequireNameToBeString ()
52
40
{
53
41
$ this ->expectException (InvalidArgumentException::class);
54
- new IndexInput (['key ' => ['x ' => 1 ], 'ns ' => ' foo.bar ' , ' name ' => 1 ]);
42
+ new IndexInput (['key ' => ['x ' => 1 ], 'name ' => 1 ]);
55
43
}
56
44
57
45
/**
58
46
* @dataProvider provideExpectedNameAndKey
59
47
*/
60
48
public function testNameGeneration ($ expectedName , array $ key )
61
49
{
62
- $ this ->assertSame ($ expectedName , (string ) new IndexInput (['key ' => $ key, ' ns ' => ' foo.bar ' ]));
50
+ $ this ->assertSame ($ expectedName , (string ) new IndexInput (['key ' => $ key ]));
63
51
}
64
52
65
53
public function provideExpectedNameAndKey ()
@@ -77,16 +65,16 @@ public function testBsonSerialization()
77
65
{
78
66
$ expected = [
79
67
'key ' => ['x ' => 1 ],
80
- 'ns ' => ' foo.bar ' ,
68
+ 'unique ' => true ,
81
69
'name ' => 'x_1 ' ,
82
70
];
83
71
84
72
$ indexInput = new IndexInput ([
85
73
'key ' => ['x ' => 1 ],
86
- 'ns ' => ' foo.bar ' ,
74
+ 'unique ' => true ,
87
75
]);
88
76
89
77
$ this ->assertInstanceOf (Serializable::class, $ indexInput );
90
- $ this ->assertEquals ($ expected , $ indexInput ->bsonSerialize ());
78
+ $ this ->assertSame ($ expected , $ indexInput ->bsonSerialize ());
91
79
}
92
80
}
0 commit comments