Beispiel #1
0
 /**
  * @covers Ilios\CoreBundle\Entity\User::getCohorts
  */
 public function testSetCohorts()
 {
     $this->assertTrue(method_exists($this->object, 'setPrimaryCohort'));
     $this->assertTrue(method_exists($this->object, 'getPrimaryCohort'));
     $obj = m::mock('Ilios\\CoreBundle\\Entity\\Cohort');
     $this->object->addCohort($obj);
     $this->object->setPrimaryCohort($obj);
     $obj2 = m::mock('Ilios\\CoreBundle\\Entity\\Cohort');
     $this->object->setCohorts(new ArrayCollection([$obj2]));
     $this->assertNull($this->object->getPrimaryCohort());
 }