/** * @dataProvider getAttachmentFixture */ public function testGetAttachments() { $this->mailbox->addMessage($this->getFixture('attachment_encoded_filename')); $message = $this->mailbox->getMessage(1); $this->assertCount(1, $message->getAttachments()); $attachment = $message->getAttachments()[0]; $this->assertEquals('Prostřeno_2014_poslední volné termíny.xls', $attachment->getFilename()); }
/** * @expectedException \Shapecode\Imap\Exception\MessageDoesNotExistException * @expectedExceptionMessageRegExp /Message 666 does not exist.*Bad message number/ */ public function testGetMessageThrowsException() { $this->mailbox->getMessage(666); }