/** * @test */ public function it_returns_true_when_top_level_folder_does_exist() { $imap = $this->getImap(false); /** @noinspection PhpUndefinedMethodInspection */ $this->mailbox->shouldReceive('getMailboxName')->with(true)->andReturn('{imap.example.com:993/imap/ssl}'); /** @noinspection PhpUndefinedMethodInspection */ $imap->shouldReceive('getFolders')->with('{imap.example.com:993/imap/ssl}', 'FOO')->andReturn([]); $mailboxManager = new ImapMailboxService($imap); $exists = $mailboxManager->folderExists('FOO'); $this->assertTrue($exists); }