<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
*
* This is in the same namespace as Crypto for mocking 'rand' and 'random_init'
*/
+
+/// @todo Use right namespace - needs alternative way of mocking random_int()
namespace Friendica\Util;
use phpseclib\Crypt\RSA;
class CryptoTest extends TestCase
{
+ public static function tearDownAfterClass(): void
+ {
+ // Reset mocking
+ global $phpMock;
+ $phpMock = [];
+
+ parent::tearDownAfterClass();
+ }
+
/**
* Replaces random_int results with given mocks
*
{
global $phpMock;
if (isset($phpMock['random_int'])) {
- $result = call_user_func_array($phpMock['random_int'], func_get_args());
- return $result;
+ return call_user_func_array($phpMock['random_int'], func_get_args());
}
}