Exemplo n.º 1
0
 /**
  * @covers Ilios\CoreBundle\Entity\Manager\CourseManager::deleteCourse
  */
 public function testDeleteCourse()
 {
     $class = 'Ilios\\CoreBundle\\Entity\\Course';
     $em = m::mock('Doctrine\\ORM\\EntityManager')->shouldReceive('persist')->shouldReceive('flush')->mock();
     $repository = m::mock('Doctrine\\ORM\\Repository');
     $registry = m::mock('Doctrine\\Bundle\\DoctrineBundle\\Registry')->shouldReceive('getManagerForClass')->andReturn($em)->shouldReceive('getRepository')->andReturn($repository)->mock();
     $entity = m::mock($class)->shouldReceive('setDeleted')->with(true)->mock();
     $manager = new CourseManager($registry, $class);
     $manager->deleteCourse($entity);
 }