예제 #1
0
파일: UserTest.php 프로젝트: Okami-/ilios
 /**
  * @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());
 }