@@ -81,7 +81,7 @@ public function it_can_parse_swa_related_multipart(): void
81
81
}
82
82
83
83
#[Test]
84
- public function it_can_parse_mtom_related_multipart (): void
84
+ public function it_can_parse_mtom_related_multipart_with_cid_compliance (): void
85
85
{
86
86
$ attachmentStorage = self ::createAttachmentsStore ();
87
87
$ responseFactory = Psr17FactoryDiscovery::findResponseFactory ();
@@ -100,14 +100,14 @@ public function it_can_parse_mtom_related_multipart(): void
100
100
<SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
101
101
</SOAP-ENV:Envelope>
102
102
-- {$ boundary }
103
- Content-ID: attachment1
103
+ Content-ID: < attachment1@domain.com>
104
104
Content-Type: text/plain
105
105
Content-Disposition: attachment; name="file1"; filename="attachment1.txt"
106
106
Content-Transfer-Encoding: binary
107
107
108
108
attachment1
109
109
-- {$ boundary }
110
- Content-ID: attachment2
110
+ Content-ID: < attachment2@domain.com>
111
111
Content-Type: text/plain
112
112
Content-Disposition: attachment; name="file2"; filename="attachment2.txt"
113
113
Content-Transfer-Encoding: binary
@@ -130,21 +130,23 @@ public function it_can_parse_mtom_related_multipart(): void
130
130
EOXML ,
131
131
(string ) $ actual ->getBody ()
132
132
);
133
- self ::assertResponseAttachments ($ attachmentStorage );
133
+ self ::assertResponseAttachments ($ attachmentStorage, [ ' <attachment1@domain.com> ' , ' <attachment2@domain.com> ' ] );
134
134
}
135
135
136
- private static function assertResponseAttachments (AttachmentStorage $ storage ): void
137
- {
136
+ private static function assertResponseAttachments (
137
+ AttachmentStorage $ storage ,
138
+ array $ expectedIds = ['attachment1 ' , 'attachment2 ' ]
139
+ ): void {
138
140
$ responseAttachments = [...$ storage ->responseAttachments ()];
139
141
static ::assertCount (2 , $ responseAttachments );
140
142
141
- static ::assertSame (' attachment1 ' , $ responseAttachments [0 ]->id );
143
+ static ::assertSame ($ expectedIds [ 0 ] , $ responseAttachments [0 ]->id );
142
144
static ::assertSame ('file1 ' , $ responseAttachments [0 ]->name );
143
145
static ::assertSame ('attachment1.txt ' , $ responseAttachments [0 ]->filename );
144
146
static ::assertSame ('text/plain ' , $ responseAttachments [0 ]->mimeType );
145
147
static ::assertSame ('attachment1 ' , $ responseAttachments [0 ]->content ->getContents ());
146
148
147
- static ::assertSame (' attachment2 ' , $ responseAttachments [1 ]->id );
149
+ static ::assertSame ($ expectedIds [ 1 ] , $ responseAttachments [1 ]->id );
148
150
static ::assertSame ('file2 ' , $ responseAttachments [1 ]->name );
149
151
static ::assertSame ('attachment2.txt ' , $ responseAttachments [1 ]->filename );
150
152
static ::assertSame ('text/plain ' , $ responseAttachments [1 ]->mimeType );
0 commit comments