ensureGetIndex() public method

Ensure an index for the get() method.
public ensureGetIndex ( array $beforeSort = [], array $afterSort = [] ) : void
$beforeSort array Fields in get() call to index before the sort field in same format as \MongoDB\Collection::ensureIndex()
$afterSort array Fields in get() call to index after the sort field in same format as \MongoDB\Collection::ensureIndex()
return void
 /**
  * @test
  * @covers ::ensureGetIndex
  * @expectedException \Exception
  */
 public function ensureGetIndexWithTooLongCollectionName()
 {
     $collectionName = 'messages012345678901234567890123456789012345678901234567890123456789';
     $collectionName .= '012345678901234567890123456789012345678901234567890123456789';
     //128 chars
     $queue = new Queue($this->mongoUrl, 'testing', $collectionName);
     $queue->ensureGetIndex([]);
 }