diff --git a/lib/Doctrine/MongoDB/Collection.php b/lib/Doctrine/MongoDB/Collection.php index 58646448..c71682f5 100644 --- a/lib/Doctrine/MongoDB/Collection.php +++ b/lib/Doctrine/MongoDB/Collection.php @@ -215,7 +215,7 @@ public function batchInsert(array &$a, array $options = array()) $this->eventManager->dispatchEvent(Events::postBatchInsert, new EventArgs($this, $result)); } - return $a; + return $result; } protected function doBatchInsert(array &$a, array $options = array()) diff --git a/tests/Doctrine/MongoDB/Tests/CollectionTest.php b/tests/Doctrine/MongoDB/Tests/CollectionTest.php index 73935825..080ebe96 100644 --- a/tests/Doctrine/MongoDB/Tests/CollectionTest.php +++ b/tests/Doctrine/MongoDB/Tests/CollectionTest.php @@ -117,7 +117,7 @@ public function testBatchInsert() $coll = $this->getTestCollection($this->getMockConnection(), $mongoCollection); - $this->assertEquals($docs, $coll->batchInsert($docs, $options)); + $this->assertTrue($coll->batchInsert($docs, $options)); } public function testUpdate()