Ejemplo n.º 1
0
 /**
  * @covers Ilios\CoreBundle\Entity\Manager\CourseManager::findCoursesBy
  */
 public function testFindCoursesDoNotIncludeDeleted()
 {
     $class = 'Ilios\\CoreBundle\\Entity\\Course';
     $em = m::mock('Doctrine\\ORM\\EntityManager');
     $repository = m::mock('Doctrine\\ORM\\Repository')->shouldReceive('findBy')->with(array('foo' => 'bar', 'deleted' => false), null, null, null)->mock();
     $registry = m::mock('Doctrine\\Bundle\\DoctrineBundle\\Registry')->shouldReceive('getManagerForClass')->andReturn($em)->shouldReceive('getRepository')->andReturn($repository)->mock();
     $manager = new CourseManager($registry, $class);
     $manager->findCoursesBy(array('foo' => 'bar'));
 }