Пример #1
0
 /**
  * @covers Core\Entity\Student::setLisUser
  * @covers Core\Entity\Student::getLisUser
  */
 public function testSetGetLisUser()
 {
     $lisUser = $this->getMockBuilder('Core\\Entity\\LisUser')->getMock();
     $this->student->setLisUser($lisUser);
     $this->assertEquals($lisUser, $this->student->getLisUser());
 }
Пример #2
0
 /**
  * Creates lisUser and associates to given Student
  * 
  * @param \Core\Entity\Student $student
  * @param array|null $data
  * 
  * @return \Core\Entity\LisUser
  */
 protected function CreateStudentUser(\Core\Entity\Student $student, $data = null)
 {
     $d = $data;
     if (!$d) {
         //if $data was not given
         $d = ['personalCode' => $student->getPersonalCode(), 'password' => uniqid(), 'email' => uniqid() . '@asd.ee'];
     }
     $lisUser = $this->em->getRepository('Core\\Entity\\LisUser')->Create($d);
     $student->setLisUser($lisUser);
     //associate
     $this->em->persist($student);
     $this->em->flush($student);
     return $lisUser;
 }
 /**
  * {@inheritDoc}
  */
 public function setLisUser($lisUser)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setLisUser', array($lisUser));
     return parent::setLisUser($lisUser);
 }