Skip to content

Commit

Permalink
DKIMTest: make exception expectation more specific
Browse files Browse the repository at this point in the history
As things were, the `DKIMTest::testDKIMSignOpenSSLNotAvailableException()` test _could_ potentially pass even when another `Exception` than the `PHPMailer\PHPMailer\Exception` was being thrown, as _all_ exceptions extend the PHP native `Exception` class.
Now this risk is not that high, as there is also a check on the exception message, but still.

Making the exception expectation more specific (by changing the import `use` statement), should still make the test more stable.
  • Loading branch information
jrfnl committed Sep 11, 2024
1 parent aaddfdf commit 10f76cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/PHPMailer/DKIMTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace PHPMailer\Test\PHPMailer;

use Exception;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\Test\SendTestCase;

Expand Down

0 comments on commit 10f76cd

Please sign in to comment.