예제 #1
0
파일: Subject.php 프로젝트: kornelek/lms
 /**
  * {@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;
 }
예제 #2
0
 /**
  * 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.');
 }
예제 #3
0
 /**
  * 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.');
 }