示例#1
0
 /**
  * @covers Core\Entity\Module::addGradingType
  * @covers Core\Entity\Module::removeGradingType
  */
 public function testAddRemoveGradingType()
 {
     $ml = new Module();
     $this->assertEquals(0, $ml->getGradingType()->count());
     $mockGradingType = $this->getMockBuilder('Core\\Entity\\GradingType')->getMock();
     $gradingtypes = new \Doctrine\Common\Collections\ArrayCollection();
     $gradingtypes->add($mockGradingType);
     $ml->addGradingType($gradingtypes);
     $this->assertEquals(1, $ml->getGradingType()->count());
     $this->assertEquals($mockGradingType, $ml->getGradingType()->first());
     $ml->removeGradingType($gradingtypes);
     $this->assertEquals(0, $ml->getGradingType()->count());
 }
 /**
  * {@inheritDoc}
  */
 public function getGradingType()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getGradingType', array());
     return parent::getGradingType();
 }
示例#3
0
 /**
  * @covers Core\Entity\Module::setGradingType
  * @covers Core\Entity\Module::getGradingType
  */
 public function testSetGetGradingType()
 {
     $mockGradingType = $this->getMockBuilder('Core\\Entity\\GradingType')->getMock();
     $this->module->setGradingType($mockGradingType);
     $this->assertEquals($mockGradingType, $this->module->getGradingType());
 }