getMail(); $this->assertEquals('An upload on %bridge_adapter% failed, the resaon is : %reason%', $mail->getMessage()); } public function testSHouldThrowALogicExceptionIfNoAdapterProvided() { $mail = MailInfoBridgeUploadFailed::create( $this->getApplication(), $this->getReceiverMock(), $this->getEmitterMock(), $this->getMessage(), $this->getUrl(), $this->getExpiration() ); $mail->setReason('you\'re too fat'); try { $mail->getMessage(); $this->fail('Should have raised an exception'); } catch (LogicException $e) { } } public function testSHouldThrowALogicExceptionIfNoReasonProvided() { $mail = MailInfoBridgeUploadFailed::create( $this->getApplication(), $this->getReceiverMock(), $this->getEmitterMock(), $this->getMessage(), $this->getUrl(), $this->getExpiration() ); $mail->setAdapter('dailymotion'); try { $mail->getMessage(); $this->fail('Should have raised an exception'); } catch (LogicException $e) { } } public function testSetReason() { $mail = $this->getMail(); $this->assertEquals('An upload on %bridge_adapter% failed, the resaon is : %reason%', $mail->getMessage()); } public function getMail() { $mail = MailInfoBridgeUploadFailed::create( $this->getApplication(), $this->getReceiverMock(), $this->getEmitterMock(), $this->getMessage(), $this->getUrl(), $this->getExpiration() ); $mail->setAdapter('dailymotion'); $mail->setReason('you\'re too fat'); return $mail; } }