Example #1
0
 public function testDrop()
 {
     $result = array('dropped' => 'databaseName', 'ok' => 1);
     $this->mongoDB->expects($this->once())->method('drop')->will($this->returnValue($result));
     $db = new Database($this->connection, $this->mongoDB, $this->eventManager);
     $this->expectEvents(array(array(Events::preDropDatabase, new EventArgs($db)), array(Events::postDropDatabase, new EventArgs($db))));
     $this->assertSame($result, $db->drop());
 }
 protected function tearDown()
 {
     $this->oid = array();
     if ($this->connection) {
         $this->connection->close();
         $this->connection = null;
     }
     if ($this->con) {
         $this->con->drop();
         $this->con = null;
     }
 }
Example #3
0
 /**
  * @see Database::drop()
  */
 public function drop()
 {
     $this->log(['dropDatabase' => true]);
     return parent::drop();
 }
Example #4
0
 /** @proxy */
 public function drop()
 {
     $this->log(array('dropDatabase' => true));
     return parent::drop();
 }