@@ -22,28 +22,32 @@ protected function setUp(): void
2222 $ this ->attachmentHelper = new AttachmentHelper ();
2323 }
2424
25- public function testRenderAttachmentListEmpty ()
25+ public function testGetAttachmentListEmpty ()
2626 {
2727 $ attachmentList = [];
28- $ result = $ this ->attachmentHelper ->renderAttachmentList ($ attachmentList );
29- $ this ->assertEquals ('' , $ result );
28+ $ result = $ this ->attachmentHelper ->getAttachmentList ($ attachmentList );
29+ $ this ->assertEquals ([] , $ result );
3030 }
3131
32- public function testRenderAttachmentListWithAttachments ()
32+ public function testGetAttachmentListWithAttachments ()
3333 {
3434 $ attachmentMock = $ this ->createMock (AbstractAttachment::class);
3535 $ attachmentMock ->method ('getMimeType ' )->willReturn ('application/pdf ' );
36- $ attachmentMock ->method ('buildUrl ' )->willReturn ('http ://example.com/file.pdf ' );
36+ $ attachmentMock ->method ('buildUrl ' )->willReturn ('https ://example.com/file.pdf ' );
3737 $ attachmentMock ->method ('getFilename ' )->willReturn ('file.pdf ' );
3838
3939 $ attachmentList = [$ attachmentMock ];
4040
41- $ result = $ this ->attachmentHelper ->renderAttachmentList ($ attachmentList );
41+ $ result = $ this ->attachmentHelper ->getAttachmentList ($ attachmentList );
4242
43- $ expectedHtml = '<p>Attached files:</p><ul> ' ;
44- $ expectedHtml .= '<li><i class="bi bi-file-pdf-o" aria-hidden="true"></i> <a href="http://example.com/file.pdf">file.pdf</a></li> ' ;
45- $ expectedHtml .= '</ul> ' ;
43+ $ expectedResult = [
44+ [
45+ 'icon ' => 'file-pdf-o ' ,
46+ 'url ' => 'https://example.com/file.pdf ' ,
47+ 'filename ' => 'file.pdf ' ,
48+ ],
49+ ];
4650
47- $ this ->assertEquals ($ expectedHtml , $ result );
51+ $ this ->assertEquals ($ expectedResult , $ result );
4852 }
4953}
0 commit comments