Skip to content

Commit 1388c68

Browse files
author
Sebastian Krätzig
committed
Update PHP Unit tests after changing the exception handling
1 parent e5b5099 commit 1388c68

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/unit/ImapTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
use Generator;
1010
use ParagonIE\HiddenString\HiddenString;
11+
use PhpImap\Exceptions\ConnectionException;
1112
use PHPUnit\Framework\TestCase as Base;
1213
use const SORTARRIVAL;
1314
use Throwable;
14-
use UnexpectedValueException;
1515

1616
/**
1717
* @psalm-type MAILBOX_ARGS = array{
@@ -35,13 +35,13 @@ class ImapTest extends Base
3535
use LiveMailboxTestingTrait;
3636

3737
/**
38-
* @psalm-return Generator<'CI ENV with invalid password'|'empty mailbox/username/password', array{0: UnexpectedValueException::class, 1: '/^IMAP error:.[AUTHENTICATIONFAILED]/'|'IMAP error:Can't open mailbox : no such mailbox', 2: array{0: HiddenString, 1: HiddenString, 2: HiddenString, 3: 0, 4: 0, 5: array<empty, empty>}, 3?: true}, mixed, void>
38+
* @psalm-return Generator<'CI ENV with invalid password'|'empty mailbox/username/password', array{0: ConnectionException::class, 1: '/^[AUTHENTICATIONFAILED]/'|'Can't open mailbox : no such mailbox', 2: array{0: HiddenString, 1: HiddenString, 2: HiddenString, 3: 0, 4: 0, 5: array<empty, empty>}, 3?: true}, mixed, void>
3939
*/
4040
public function OpenFailure(): Generator
4141
{
4242
yield 'empty mailbox/username/password' => [
43-
UnexpectedValueException::class,
44-
'IMAP error:Can\'t open mailbox : no such mailbox',
43+
ConnectionException::class,
44+
'Can\'t open mailbox : no such mailbox',
4545
[
4646
new HiddenString(''),
4747
new HiddenString(''),
@@ -58,8 +58,8 @@ public function OpenFailure(): Generator
5858

5959
if (\is_string($imapPath) && \is_string($login) && \is_string($password)) {
6060
yield 'CI ENV with invalid password' => [
61-
UnexpectedValueException::class,
62-
'/^IMAP error:.*\[AUTHENTICATIONFAILED\].*/',
61+
ConnectionException::class,
62+
'/^\[AUTHENTICATIONFAILED\].*/',
6363
[
6464
new HiddenString($imapPath, true, true),
6565
new HiddenString($login, true, true),

0 commit comments

Comments
 (0)