--TEST-- MongoDB\Driver\BulkWriteCommandResult::isAcknowledged() with unacknowledged write concern --SKIPIF-- --FILE-- 0]); $bulk = new MongoDB\Driver\BulkWriteCommand(['ordered' => false]); $bulk->insertOne(NS, ['_id' => 1]); $result = $manager->executeBulkWriteCommand($bulk); var_dump($result->isAcknowledged()); // Additionally test that other accessor methods cannot be called echo throws(function() use ($result) { $result->getInsertedCount(); }, MongoDB\Driver\Exception\LogicException::class), "\n"; echo throws(function() use ($result) { $result->getMatchedCount(); }, MongoDB\Driver\Exception\LogicException::class), "\n"; echo throws(function() use ($result) { $result->getModifiedCount(); }, MongoDB\Driver\Exception\LogicException::class), "\n"; echo throws(function() use ($result) { $result->getUpsertedCount(); }, MongoDB\Driver\Exception\LogicException::class), "\n"; echo throws(function() use ($result) { $result->getDeletedCount(); }, MongoDB\Driver\Exception\LogicException::class), "\n"; echo throws(function() use ($result) { $result->getInsertResults(); }, MongoDB\Driver\Exception\LogicException::class), "\n"; echo throws(function() use ($result) { $result->getUpdateResults(); }, MongoDB\Driver\Exception\LogicException::class), "\n"; echo throws(function() use ($result) { $result->getDeleteResults(); }, MongoDB\Driver\Exception\LogicException::class), "\n"; ?> ===DONE=== --EXPECT-- bool(false) OK: Got MongoDB\Driver\Exception\LogicException MongoDB\Driver\BulkWriteCommandResult::getInsertedCount() should not be called for an unacknowledged write result OK: Got MongoDB\Driver\Exception\LogicException MongoDB\Driver\BulkWriteCommandResult::getMatchedCount() should not be called for an unacknowledged write result OK: Got MongoDB\Driver\Exception\LogicException MongoDB\Driver\BulkWriteCommandResult::getModifiedCount() should not be called for an unacknowledged write result OK: Got MongoDB\Driver\Exception\LogicException MongoDB\Driver\BulkWriteCommandResult::getUpsertedCount() should not be called for an unacknowledged write result OK: Got MongoDB\Driver\Exception\LogicException MongoDB\Driver\BulkWriteCommandResult::getDeletedCount() should not be called for an unacknowledged write result OK: Got MongoDB\Driver\Exception\LogicException MongoDB\Driver\BulkWriteCommandResult::getInsertResults() should not be called for an unacknowledged write result OK: Got MongoDB\Driver\Exception\LogicException MongoDB\Driver\BulkWriteCommandResult::getUpdateResults() should not be called for an unacknowledged write result OK: Got MongoDB\Driver\Exception\LogicException MongoDB\Driver\BulkWriteCommandResult::getDeleteResults() should not be called for an unacknowledged write result ===DONE===