function __construct(Mailbox $mailbox) { $this->mailbox = $mailbox; if (!($this->connection = $this->connect())) { throw new Exception('Unable to connect to to mailbox: ' . $this->mailbox->getServer()); } }
/** * @test */ public function it_sets_the_server() { $this->mailbox->setServer('foo'); $this->assertEquals('foo', $this->mailbox->getServer()); }