X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCivi%2FCrypto%2FCryptoTokenTest.php;h=64d3e310a98af857125ad4ef1066a730a945bb33;hb=7c5110c362e57b9c424829070f8e13274bbe0cfd;hp=961166a89a011a2c2059d0132272d3bbef271d57;hpb=8d3452c40914685bfcbdd48ce9e471415e4d1d51;p=civicrm-core.git diff --git a/tests/phpunit/Civi/Crypto/CryptoTokenTest.php b/tests/phpunit/Civi/Crypto/CryptoTokenTest.php index 961166a89a..64d3e310a9 100644 --- a/tests/phpunit/Civi/Crypto/CryptoTokenTest.php +++ b/tests/phpunit/Civi/Crypto/CryptoTokenTest.php @@ -66,4 +66,12 @@ class CryptoTokenTest extends \CiviUnitTestCase { $this->assertEquals($inputText, $actualText); } + public function testReadPlainTextWithoutRegistry() { + // This is performance optimization - don't initialize crypto.registry unless + // you actually need it. + $this->assertFalse(\Civi::container()->initialized('crypto.registry')); + $this->assertEquals("Hello world", \Civi::service('crypto.token')->decrypt("Hello world")); + $this->assertFalse(\Civi::container()->initialized('crypto.registry')); + } + }