| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
namespace Tests\issues; |
| 14 |
|
| 15 |
use Tests\live\LiveMailboxTestCase; |
| 16 |
use Webklex\PHPIMAP\Exceptions\AuthFailedException; |
| 17 |
use Webklex\PHPIMAP\Exceptions\ConnectionFailedException; |
| 18 |
use Webklex\PHPIMAP\Exceptions\EventNotFoundException; |
| 19 |
use Webklex\PHPIMAP\Exceptions\FolderFetchingException; |
| 20 |
use Webklex\PHPIMAP\Exceptions\ImapBadRequestException; |
| 21 |
use Webklex\PHPIMAP\Exceptions\ImapServerErrorException; |
| 22 |
use Webklex\PHPIMAP\Exceptions\MaskNotFoundException; |
| 23 |
use Webklex\PHPIMAP\Exceptions\ResponseException; |
| 24 |
use Webklex\PHPIMAP\Exceptions\RuntimeException; |
| 25 |
use Webklex\PHPIMAP\Folder; |
| 26 |
|
| 27 |
class Issue393Test extends LiveMailboxTestCase { |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
public function testIssue(): void { |
| 43 |
$client = $this->getClient(); |
| 44 |
$client->connect(); |
| 45 |
|
| 46 |
$delimiter = $this->getManager()->getConfig()->get("options.delimiter"); |
| 47 |
$pattern = implode($delimiter, ['doesnt_exist', '%']); |
| 48 |
|
| 49 |
$folder = $client->getFolder('doesnt_exist'); |
| 50 |
$this->deleteFolder($folder); |
| 51 |
|
| 52 |
$folders = $client->getFolders(true, $pattern, true); |
| 53 |
self::assertCount(0, $folders); |
| 54 |
|
| 55 |
try { |
| 56 |
$client->getFolders(true, $pattern, false); |
| 57 |
$this->fail('Expected FolderFetchingException::class exception not thrown'); |
| 58 |
} catch (FolderFetchingException $e) { |
| 59 |
self::assertInstanceOf(FolderFetchingException::class, $e); |
| 60 |
} |
| 61 |
} |
| 62 |
} |