function testInvalidBatchInsert() { /* Invalid document for Model2 */ $documents = array(array('foo' => 'bar')); try { /* Invalid call */ ActiveMongo::BatchInsert($documents); $this->assertTrue(False); } catch (ActiveMongo_Exception $e) { $this->assertTrue(TRUE); } try { Model2::BatchInsert($documents); $this->assertTrue(False); } catch (ActiveMongo_FilterException $e) { $this->assertTrue(FALSE); } catch (MongoException $e) { $this->assertTrue(TRUE); } try { Model2::BatchInsert($documents, TRUE, FALSE); $this->assertTrue(False); } catch (ActiveMongo_FilterException $e) { $this->assertTrue(TRUE); } }