public function testAffectedByErrorIfClosedException($methodName)
{
$this->setExpectedException('Doctrine\\ODM\\MongoDB\\MongoDBException', 'closed');
$this->dm->close();
if ($methodName === 'flush') {
$this->dm->{$methodName}();
} else {
$this->dm->{$methodName}(new \stdClass());
}
}