public function testGetItem() { $msg = new \stdClass(); $this->storage->expects($this->at(0))->method('getNumberByUniqueId')->with($this->equalTo(123))->will($this->returnValue(12345)); $this->storage->expects($this->at(1))->method('getMessage')->with($this->equalTo(12345))->will($this->returnValue($msg)); $result = $this->connector->getItem(123); $this->assertTrue($msg === $result); }
/** * Retrieve email by its UID * * @param int $uid The UID of an email message * * @return Email|null An Email DTO or null if an email with the given UID was not found */ public function findEmail($uid) { try { $msg = $this->connector->getItem($uid); return $this->convertToEmail($msg); } catch (MailException\InvalidArgumentException $ex) { return null; } }