예제 #1
0
파일: UserTest.php 프로젝트: Okami-/ilios
 /**
  * @covers Ilios\CoreBundle\Entity\User::setPrimaryCohort
  * @covers Ilios\CoreBundle\Entity\User::getPrimaryCohort
  */
 public function testSetPrimaryCohort()
 {
     $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);
     $this->assertSame($obj, $this->object->getPrimaryCohort());
     $this->assertTrue($this->object->getCohorts()->contains($obj));
 }