Example #1
0
 public function testGetSetSlaveOkay()
 {
     if (version_compare(phpversion('mongo'), '1.3.0', '>=')) {
         $this->markTestSkipped('This test is not applicable to driver versions >= 1.3.0');
     }
     $this->mongodb->expects($this->once())->method('getSlaveOkay')->will($this->returnValue(false));
     $this->mongodb->expects($this->once())->method('setSlaveOkay')->with(true)->will($this->returnValue(false));
     $database = new Database($this->connection, 'test', $this->getMockEventManager(), '$');
     $this->assertEquals(false, $database->getSlaveOkay());
     $this->assertEquals(false, $database->setSlaveOkay(true));
 }