/** * @test */ public function it_gets_the_unread_message_count() { $imap = $this->getImap(); /** @noinspection PhpUndefinedMethodInspection */ $imap->shouldReceive('getStatus')->with(SA_UNSEEN)->andReturn((object) ['unseen' => 5]); $mailboxManager = new ImapMailboxService($imap); $this->assertEquals(5, $mailboxManager->getUnreadMessageCount()); }