Пример #1
0
 /**
  * @covers Core\Entity\SubjectRound::setTeacher
  * @covers Core\Entity\SubjectRound::getTeacher
  */
 public function testSetGetTeacher()
 {
     $mockTeacher = $this->getMockBuilder('Core\\Entity\\Teacher')->getMock();
     $this->subjectRound->setTeacher($mockTeacher);
     $this->assertEquals($mockTeacher, $this->subjectRound->getTeacher());
 }
Пример #2
0
 /**
  * @covers Core\Entity\SubjectRound::addTeacher
  * @covers Core\Entity\SubjectRound::removeTeacher
  */
 public function testAddRemoveTeacher()
 {
     $sr = new SubjectRound();
     $this->assertEquals(0, $sr->getTeacher()->count());
     $mockTeacher = $this->getMockBuilder('Core\\Entity\\Teacher')->getMock();
     $teachers = new \Doctrine\Common\Collections\ArrayCollection();
     $teachers->add($mockTeacher);
     $sr->addTeacher($teachers);
     $this->assertEquals(1, $sr->getTeacher()->count());
     $this->assertEquals($mockTeacher, $sr->getTeacher()->first());
     $sr->removeTeacher($teachers);
     $this->assertEquals(0, $sr->getTeacher()->count());
 }
 /**
  * {@inheritDoc}
  */
 public function getTeacher()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getTeacher', array());
     return parent::getTeacher();
 }