예제 #1
0
파일: Collection.php 프로젝트: kornelek/lms
 /**
  * {@inheritDoc}
  */
 public function registerSubject($id, SubjectInterface $subject)
 {
     if (isset($this->subjects[$id])) {
         throw CollectionException::idUsed($id);
     }
     $this->subjects[$id] = $subject;
 }
예제 #2
0
 /**
  * Make sure we get the message we are expecting.
  */
 public function testIdUsed()
 {
     $this->assertEquals('The "test" subject unique identifier is already in use.', CollectionException::idUsed('test')->getMessage(), 'Make sure we get the right message.');
 }