diff --git a/tests/session/session-startTransaction_error-006.phpt b/tests/session/session-startTransaction_error-006.phpt new file mode 100644 index 000000000..0432e38a3 --- /dev/null +++ b/tests/session/session-startTransaction_error-006.phpt @@ -0,0 +1,26 @@ +--TEST-- +MongoDB\Driver\Session::startTransaction() throws an error on replicasets < 4.0 +--SKIPIF-- + + + + +=', '4.0'); ?> +--FILE-- +startSession(); + +echo throws(function () use ($session) { + $session->startTransaction(); +}, MongoDB\Driver\Exception\RuntimeException::class), "\n"; + +?> +===DONE=== + +--EXPECT-- +OK: Got MongoDB\Driver\Exception\RuntimeException +Multi-document transactions are not supported by this server version +===DONE=== diff --git a/tests/session/session-startTransaction_error-007.phpt b/tests/session/session-startTransaction_error-007.phpt new file mode 100644 index 000000000..0a82c1b69 --- /dev/null +++ b/tests/session/session-startTransaction_error-007.phpt @@ -0,0 +1,26 @@ +--TEST-- +MongoDB\Driver\Session::startTransaction() throws an error on sharded clusters < 4.2 +--SKIPIF-- + + + + +=', '4.2'); ?> +--FILE-- +startSession(); + +echo throws(function () use ($session) { + $session->startTransaction(); +}, MongoDB\Driver\Exception\RuntimeException::class), "\n"; + +?> +===DONE=== + +--EXPECT-- +OK: Got MongoDB\Driver\Exception\RuntimeException +Multi-document transactions are not supported by this server version +===DONE===