@@ -40,6 +40,7 @@ public function __construct($name = null, array $data = [], $dataName = '')
4040 {
4141 parent ::__construct ($ name , $ data , $ dataName );
4242 $ plugin = new tls_icon ();
43+ $ plugin ->init ();
4344 $ this ->strUnEnCrypted = '<img class="lock_icon" src=" ' . $ plugin ->get_svg_path ('unlock.svg ' ) . '" title="Message received over an unencrypted connection!" /> ' ;
4445 $ this ->strCryptedTlsv12 = '<img class="lock_icon" src=" ' . $ plugin ->get_svg_path ('lock.svg ' ) . '" title="TLSv1.2" /> ' ;
4546 $ this ->strCryptedTlsv12WithCipher = '<img class="lock_icon" src=" ' . $ plugin ->get_svg_path ('lock.svg ' ) . '" title="TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)" /> ' ;
@@ -53,12 +54,14 @@ public function __construct($name = null, array $data = [], $dataName = '')
5354 public function testInstance ()
5455 {
5556 $ o = new tls_icon ();
57+ $ o ->init ();
5658 $ this ->assertInstanceOf ('tls_icon ' , $ o );
5759 }
5860
5961 public function testStorage_Init ()
6062 {
6163 $ o = new tls_icon ();
64+ $ o ->init ();
6265 $ this ->assertSame ([
6366 'fetch_headers ' => 'RECEIVED '
6467 ], $ o ->storage_init ([]));
@@ -76,12 +79,14 @@ public function testStorage_Init()
7679 public function testMessageHeadersNothing ()
7780 {
7881 $ o = new tls_icon ();
82+ $ o ->init ();
7983 $ this ->assertSame ([], $ o ->message_headers ([]));
8084 }
8185
8286 public function testMessageHeadersNoMatching ()
8387 {
8488 $ o = new tls_icon ();
89+ $ o ->init ();
8590 $ headersProcessed = $ o ->message_headers ([
8691 'output ' => [
8792 'subject ' => [
@@ -112,6 +117,7 @@ public function testMessageHeadersNoMatching()
112117 public function testMessageHeadersTlsWithCipher ()
113118 {
114119 $ o = new tls_icon ();
120+ $ o ->init ();
115121 $ headersProcessed = $ o ->message_headers ([
116122 'output ' => [
117123 'subject ' => [
@@ -148,6 +154,7 @@ public function testMessageHeadersTlsWithCipher()
148154 public function testMessageHeadersTls ()
149155 {
150156 $ o = new tls_icon ();
157+ $ o ->init ();
151158 $ headersProcessed = $ o ->message_headers ([
152159 'output ' => [
153160 'subject ' => [
@@ -184,6 +191,7 @@ public function testMessageHeadersTls()
184191 public function testMessageHeadersInternal ()
185192 {
186193 $ o = new tls_icon ();
194+ $ o ->init ();
187195 $ headersProcessed = $ o ->message_headers ([
188196 'output ' => [
189197 'subject ' => [
@@ -217,6 +225,7 @@ public function testMessageHeadersInternal()
217225 public function testMessageHeadersInternalLocalhostIPv4 ()
218226 {
219227 $ o = new tls_icon ();
228+ $ o ->init ();
220229 $ headersProcessed = $ o ->message_headers ([
221230 'output ' => [
222231 'subject ' => [
@@ -249,6 +258,7 @@ public function testMessageHeadersInternalLocalhostIPv4()
249258 public function testMessageHeadersInternalLocalhostIPv6 ()
250259 {
251260 $ o = new tls_icon ();
261+ $ o ->init ();
252262 $ headersProcessed = $ o ->message_headers ([
253263 'output ' => [
254264 'subject ' => [
@@ -287,6 +297,7 @@ public function testPostfixTLS13NewSyntax()
287297 for <test@example.com>; Tue, 16 Sep 2025 12:26:17 +0200 (CEST) ' ;
288298
289299 $ o = new tls_icon ();
300+ $ o ->init ();
290301 $ headersProcessed = $ o ->message_headers ([
291302 'output ' => [
292303 'subject ' => [
@@ -432,6 +443,7 @@ public function testSendmailTLS13NoVerify()
432443 public function testSendmailTLS12WithVerify ()
433444 {
434445 $ o = new tls_icon ();
446+ $ o ->init ();
435447 $ headersProcessed = $ o ->message_headers ([
436448 'output ' => [
437449 'subject ' => [
@@ -468,6 +480,7 @@ public function testSendmailTLS12WithVerify()
468480 public function testSendmailTLS13MultipleRecipients ()
469481 {
470482 $ o = new tls_icon ();
483+ $ o ->init ();
471484 $ headersProcessed = $ o ->message_headers ([
472485 'output ' => [
473486 'subject ' => [
@@ -504,6 +517,7 @@ public function testSendmailTLS13MultipleRecipients()
504517 public function testStalwartTls ()
505518 {
506519 $ o = new tls_icon ();
520+ $ o ->init ();
507521 $ headersProcessed = $ o ->message_headers ([
508522 'output ' => [
509523 'subject ' => [
@@ -537,42 +551,27 @@ public function testStalwartTls()
537551 ], $ headersProcessed );
538552 }
539553
540- /**
541- * @runInSeparateProcess
542- */
543- public function testGetSvgPathPre17 ()
554+ public function testAssetUrlStubCanReturnLegacyPath ()
544555 {
545- if (!defined ('RCMAIL_VERSION ' )) {
546- define ('RCMAIL_VERSION ' , '1.6.9 ' );
547- }
556+ $ rcmail = rcmail::get_instance ();
557+ $ rcmail ->output ->set_asset_url_callback (function ($ path ) {
558+ return 'plugins/tls_icon/ ' . basename ($ path );
559+ });
548560
549561 $ plugin = new tls_icon ();
562+ $ plugin ->init ();
550563 $ this ->assertSame ('plugins/tls_icon/lock.svg ' , $ plugin ->get_svg_path ('lock.svg ' ));
551564 }
552565
553- /**
554- * @runInSeparateProcess
555- */
556- public function testGetSvgPath17 ()
566+ public function testAssetUrlStubCanReturnStaticPhpPath ()
557567 {
558- if (!defined ('RCMAIL_VERSION ' )) {
559- define ('RCMAIL_VERSION ' , '1.7.0 ' );
560- }
561-
562- $ plugin = new tls_icon ();
563- $ this ->assertSame ('static.php/plugins/tls_icon/lock.svg ' , $ plugin ->get_svg_path ('lock.svg ' ));
564- }
565-
566- /**
567- * @runInSeparateProcess
568- */
569- public function testGetSvgPath17Git ()
570- {
571- if (!defined ('RCMAIL_VERSION ' )) {
572- define ('RCMAIL_VERSION ' , '1.7-git ' );
573- }
568+ $ rcmail = rcmail::get_instance ();
569+ $ rcmail ->output ->set_asset_url_callback (function ($ path ) {
570+ return 'static.php/ ' . $ path ;
571+ });
574572
575573 $ plugin = new tls_icon ();
574+ $ plugin ->init ();
576575 $ this ->assertSame ('static.php/plugins/tls_icon/lock.svg ' , $ plugin ->get_svg_path ('lock.svg ' ));
577576 }
578577}
0 commit comments