@@ -36,30 +36,18 @@ public function provideInvalidFieldOrderValues()
3636 return $ this ->wrapValuesForDataProvider ([true , [], new stdClass ()]);
3737 }
3838
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-
5139 public function testConstructorShouldRequireNameToBeString ()
5240 {
5341 $ this ->expectException (InvalidArgumentException::class);
54- new IndexInput (['key ' => ['x ' => 1 ], 'ns ' => ' foo.bar ' , ' name ' => 1 ]);
42+ new IndexInput (['key ' => ['x ' => 1 ], 'name ' => 1 ]);
5543 }
5644
5745 /**
5846 * @dataProvider provideExpectedNameAndKey
5947 */
6048 public function testNameGeneration ($ expectedName , array $ key )
6149 {
62- $ this ->assertSame ($ expectedName , (string ) new IndexInput (['key ' => $ key, ' ns ' => ' foo.bar ' ]));
50+ $ this ->assertSame ($ expectedName , (string ) new IndexInput (['key ' => $ key ]));
6351 }
6452
6553 public function provideExpectedNameAndKey ()
@@ -77,16 +65,16 @@ public function testBsonSerialization()
7765 {
7866 $ expected = [
7967 'key ' => ['x ' => 1 ],
80- 'ns ' => ' foo.bar ' ,
68+ 'unique ' => true ,
8169 'name ' => 'x_1 ' ,
8270 ];
8371
8472 $ indexInput = new IndexInput ([
8573 'key ' => ['x ' => 1 ],
86- 'ns ' => ' foo.bar ' ,
74+ 'unique ' => true ,
8775 ]);
8876
8977 $ this ->assertInstanceOf (Serializable::class, $ indexInput );
90- $ this ->assertEquals ($ expected , $ indexInput ->bsonSerialize ());
78+ $ this ->assertSame ($ expected , $ indexInput ->bsonSerialize ());
9179 }
9280}
0 commit comments