/** * {@inheritDoc} */ public function interruptUpdate(ReasonException $reason = null) { if (false === $this->updating) { throw SubjectException::notUpdating(); } if (null === $reason) { $reason = ReasonException::notSpecified(); } $this->reason = $reason; $this->updating = false; }
/** * Make sure that we can get the reason for the interrupted update. */ public function testGetInterruptReason() { $reason = ReasonException::notSpecified(); Property::set($this->subject, 'reason', $reason); $this->assertSame($reason, $this->subject->getInterruptReason(), 'Make sure we can retrieve the reason for the interrupted update.'); }
/** * Make sure that we get the message we are expecting. */ public function testNotSpecified() { $this->assertEquals('(no reason specified)', ReasonException::notSpecified()->getMessage(), 'Make sure we get the right message.'); }