@@ -84,8 +84,8 @@ public function testCreateIndex()
84
84
$ that ->assertFalse ($ info ->isTtl ());
85
85
});
86
86
87
- $ this ->assertSame ('t_1 ' , $ this ->collection ->createIndex (array ('t ' => 1 ), array ('expireAfterSeconds ' => 0 )));
88
- $ this ->assertIndexExists ('t_1 ' , function (IndexInfo $ info ) use ($ that ) {
87
+ $ this ->assertSame ('my_ttl ' , $ this ->collection ->createIndex (array ('t ' => 1 ), array ('expireAfterSeconds ' => 0 , ' name ' => ' my_ttl ' )));
88
+ $ this ->assertIndexExists ('my_ttl ' , function (IndexInfo $ info ) use ($ that ) {
89
89
$ that ->assertFalse ($ info ->isSparse ());
90
90
$ that ->assertFalse ($ info ->isUnique ());
91
91
$ that ->assertTrue ($ info ->isTtl ());
@@ -96,13 +96,13 @@ public function testCreateIndexes()
96
96
{
97
97
$ that = $ this ;
98
98
99
- $ expectedNames = array ('x_1 ' , 'y_-1_z_1 ' , 'g_2dsphere_z_1 ' , 't_1 ' );
99
+ $ expectedNames = array ('x_1 ' , 'y_-1_z_1 ' , 'g_2dsphere_z_1 ' , 'my_ttl ' );
100
100
101
101
$ indexes = array (
102
102
array ('key ' => array ('x ' => 1 ), 'sparse ' => true , 'unique ' => true ),
103
103
array ('key ' => array ('y ' => -1 , 'z ' => 1 )),
104
104
array ('key ' => array ('g ' => '2dsphere ' , 'z ' => 1 )),
105
- array ('key ' => array ('t ' => 1 ), 'expireAfterSeconds ' => 0 ),
105
+ array ('key ' => array ('t ' => 1 ), 'expireAfterSeconds ' => 0 , ' name ' => ' my_ttl ' ),
106
106
);
107
107
108
108
$ this ->assertSame ($ expectedNames , $ this ->collection ->createIndexes ($ indexes ));
@@ -125,7 +125,7 @@ public function testCreateIndexes()
125
125
$ that ->assertFalse ($ info ->isTtl ());
126
126
});
127
127
128
- $ this ->assertIndexExists ('t_1 ' , function (IndexInfo $ info ) use ($ that ) {
128
+ $ this ->assertIndexExists ('my_ttl ' , function (IndexInfo $ info ) use ($ that ) {
129
129
$ that ->assertFalse ($ info ->isSparse ());
130
130
$ that ->assertFalse ($ info ->isUnique ());
131
131
$ that ->assertTrue ($ info ->isTtl ());
0 commit comments