@@ -134,8 +134,14 @@ public function testChecksumFileCompromisedArchive()
134
134
$ public_key = file_get_contents (__DIR__ . '/fixtures/checksumlist.pub ' );
135
135
$ var = new Verifier ($ public_key );
136
136
$ this ->expectException (VerifierException::class);
137
- $ this ->expectExceptionMessage ('File "payload-compromised.zip" does not pass checksum verification. ' );
138
- $ var ->verifyChecksumFile (__DIR__ . '/fixtures/checksumlist-compromised.sig ' );
137
+ $ this ->expectExceptionMessage ('Checksum list could not be verified. ' );
138
+ try {
139
+ $ var ->verifyChecksumFile (__DIR__ . '/fixtures/checksumlist-compromised.sig ' );
140
+ }
141
+ catch (VerifierException $ exception ) {
142
+ $ this ->assertEquals ('File "payload-compromised.zip" does not pass checksum verification. ' , $ exception ->getVerificationFailures ()[0 ]);
143
+ throw $ exception ;
144
+ }
139
145
}
140
146
141
147
/**
@@ -168,8 +174,14 @@ public function testChecksumListUnreadableFile()
168
174
$ var = new Verifier ($ public_key );
169
175
$ signed_checksumlist = file_get_contents (__DIR__ . '/fixtures/checksumlist.sig ' );
170
176
$ this ->expectException (VerifierException::class);
171
- $ this ->expectExceptionMessage ('File "payload.zip" in the checksum list could not be read. ' );
172
- $ var ->verifyChecksumList ($ signed_checksumlist , __DIR__ . '/intentionally wrong path ' );
177
+ $ this ->expectExceptionMessage ('Checksum list could not be verified. ' );
178
+ try {
179
+ $ var ->verifyChecksumList ($ signed_checksumlist , __DIR__ . '/intentionally wrong path ' );
180
+ }
181
+ catch (VerifierException $ exception ) {
182
+ $ this ->assertEquals ('File "payload.zip" in the checksum list could not be read. ' , $ exception ->getVerificationFailures ()[0 ]);
183
+ throw $ exception ;
184
+ }
173
185
}
174
186
175
187
public function testDefaultGetNow ()
0 commit comments