Example #1
0
 /**
  * @expectedException \BadMethodCallException
  */
 public function testTimeoutShouldThrowExceptionForOldDrivers()
 {
     if (method_exists('MongoCommandCursor', 'timeout')) {
         $this->markTestSkipped('This test is not applicable to drivers with MongoCommandCursor::timeout()');
     }
     $commandCursor = new CommandCursor($this->getMockMongoCommandCursor());
     $commandCursor->timeout(1000);
 }
Example #2
0
 /**
  * Wrapper method for MongoCommandCursor::timeout().
  *
  * @see http://php.net/manual/en/mongocommandcursor.timeout.php
  * @param integer $ms
  * @return self
  * @throws BadMethodCallException if MongoCommandCursor::timeout() is not available
  */
 public function timeout($ms)
 {
     $this->commandCursor->timeout($ms);
     return $this;
 }