Example #1
0
 /**
  * @expectedException \Sokil\Mongo\Exception
  * @expectedExceptionMessage Insert error
  */
 public function testInsert_Unacknowledged_Error()
 {
     $this->collectionMock = $this->getMock('\\MongoCollection', array('insert'), array($this->database->getMongoDB(), 'phpmongo_test_collection'));
     $this->collectionMock->expects($this->once())->method('insert')->will($this->returnValue(false));
     $collection = new Collection($this->database, $this->collectionMock);
     $collection->setUnacknowledgedWriteConcern();
     $collection->insert(array('a' => 1, 'b' => 2));
 }