Skip to content

Commit

Permalink
Update PHP Unit tests after changing the exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Krätzig committed Jan 7, 2022
1 parent e5b5099 commit 1388c68
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/ImapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

use Generator;
use ParagonIE\HiddenString\HiddenString;
use PhpImap\Exceptions\ConnectionException;
use PHPUnit\Framework\TestCase as Base;
use const SORTARRIVAL;
use Throwable;
use UnexpectedValueException;

/**
* @psalm-type MAILBOX_ARGS = array{
Expand All @@ -35,13 +35,13 @@ class ImapTest extends Base
use LiveMailboxTestingTrait;

/**
* @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>
* @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>
*/
public function OpenFailure(): Generator
{
yield 'empty mailbox/username/password' => [
UnexpectedValueException::class,
'IMAP error:Can\'t open mailbox : no such mailbox',
ConnectionException::class,
'Can\'t open mailbox : no such mailbox',
[
new HiddenString(''),
new HiddenString(''),
Expand All @@ -58,8 +58,8 @@ public function OpenFailure(): Generator

if (\is_string($imapPath) && \is_string($login) && \is_string($password)) {
yield 'CI ENV with invalid password' => [
UnexpectedValueException::class,
'/^IMAP error:.*\[AUTHENTICATIONFAILED\].*/',
ConnectionException::class,
'/^\[AUTHENTICATIONFAILED\].*/',
[
new HiddenString($imapPath, true, true),
new HiddenString($login, true, true),
Expand Down

0 comments on commit 1388c68

Please sign in to comment.