mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-03-29 12:22:07 +02:00
* Remove pre-3.6 server versions from Evergreen matrix * Remove skipped tests for pre-3.6 servers * Remove old mongo-orchestration configs and Evergreen tasks * Remove flaky replica set tests These tests assume a particular replica set member is always the primary, so tag assertions may fail if a different member is elected. The server-getTags-002.phpt test has more flexible assertions for replica set tags, so we can safely remove these tests.
28 lines
1016 B
PHP
28 lines
1016 B
PHP
--TEST--
|
|
MongoDB\Driver\ClientEncryption::decrypt()
|
|
--SKIPIF--
|
|
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
|
|
<?php skip_if_not_libmongocrypt(); ?>
|
|
<?php skip_if_not_live(); ?>
|
|
<?php skip_if_not_server_storage_engine('wiredTiger'); ?>
|
|
--FILE--
|
|
<?php
|
|
require_once __DIR__ . "/../utils/basic.inc";
|
|
|
|
$key = base64_decode('Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk');
|
|
|
|
$manager = create_test_manager();
|
|
$clientEncryption = $manager->createClientEncryption(['keyVaultNamespace' => 'default.keys', 'kmsProviders' => ['local' => ['key' => new MongoDB\BSON\Binary($key, 0)]]]);
|
|
|
|
$key = $clientEncryption->createDataKey('local');
|
|
|
|
$encrypted = $clientEncryption->encrypt('top-secret', ['keyId' => $key, 'algorithm' => MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC]);
|
|
var_dump($clientEncryption->decrypt($encrypted));
|
|
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECTF--
|
|
string(10) "top-secret"
|
|
===DONE===
|