]> git.mxchange.org Git - friendica.git/blob - library/defuse/php-encryption-1.2.1/tests/runtime.php
Merge develop into 20170321_-_frio-fbbrowser
[friendica.git] / library / defuse / php-encryption-1.2.1 / tests / runtime.php
1 <?php
2
3 // Set the encoding to something more "challenging."
4 $ret = mb_internal_encoding('UTF-8');
5 if ($ret === FALSE) {
6     echo "Couldn't set encoding.";
7     exit(1);
8 }
9
10 // Dump out the settings / encoding for future reference.
11 $val = ini_get("mbstring.func_overload");
12 echo "Settings: \n";
13 echo "    func_overload: " . $val . "\n";
14 echo "    mb_internal_encoding(): " . mb_internal_encoding() . "\n";
15
16 // Perform the tests.
17 require_once('Crypto.php');
18 try {
19     Crypto::RuntimeTest();
20     echo "TEST PASSED!\n";
21     exit(0);
22 } catch (CryptoTestFailedException $ex) {
23     echo "TEST FAILED!\n";
24     var_dump($ex);
25     exit(1);
26 } catch (CannotPerformOperationException $ex) {
27     echo "TEST FAILED\n";
28     var_dump($ex);
29     exit(1);
30 }
31
32 ?>