--TEST-- MongoDB\Driver\ClientEncryption::rewrapManyDataKey() masterKey option requires provider --SKIPIF-- createClientEncryption([ 'keyVaultNamespace' => CSFLE_KEY_VAULT_NS, 'kmsProviders' => ['local' => ['key' => new MongoDB\BSON\Binary(CSFLE_LOCAL_KEY, 0)]], ]); echo throws(function () use ($clientEncryption) { $clientEncryption->rewrapManyDataKey([], ['masterKey' => []]); }, MongoDB\Driver\Exception\InvalidArgumentException::class), "\n"; ?> ===DONE=== --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException The "masterKey" option should not be specified without "provider" ===DONE===