public function getValidRecipient() { $recipient = new Recipient(); $recipient->setId(1); $recipient->setPaperAddress($this->getValidPaperAddress()); try { $recipient->verify(); } catch (Element $e) { throw new Exception('Recipient is not valid'); } return $recipient; }
public static function getValidRecipient($version) { $recipients = self::validContent(); if (!isset($recipients[$version])) { throw new Exception('Recipient is not valid'); } $recipient = new Recipient(); $recipient->setId($recipients[$version][0]); $recipient->setPaperAddress($recipients[$version][1]); $recipient->setCategory($recipients[$version][2]); try { $recipient->verify(); } catch (Element $e) { throw new Exception('Recipient is not valid'); } return $recipient; }