public function testShortMbox() { $fh = fopen($this->_mboxFile, 'w'); fputs($fh, "From \r\nSubject: test\r\nFrom \r\nSubject: test2\r\n"); fclose($fh); $mail = new Storage\Mbox(array('filename' => $this->_mboxFile)); $this->assertEquals($mail->countMessages(), 2); $this->assertEquals($mail->getMessage(1)->subject, 'test'); $this->assertEquals($mail->getMessage(1)->getContent(), ''); $this->assertEquals($mail->getMessage(2)->subject, 'test2'); $this->assertEquals($mail->getMessage(2)->getContent(), ''); }
/** * magic method for unserialize(), with this method you can cache the mbox class */ public function __wakeup() { // if cache is stall selectFolder() rebuilds the tree on error parent::__wakeup(); }
public function testFallback() { $list = new Storage\Mbox(array('filename' => $this->_mboxFile)); $result = $list->noop(); $this->assertTrue($result); }
public function testFallback() { $list = new Storage\Mbox(array('filename' => $this->_mboxFile)); try { $result = $list->noop(); $this->assertTrue($result); } catch (\Exception $e) { $this->fail('exception raised while calling noop thru fallback'); } }