/** * @covers Ilios\CoreBundle\Entity\Manager\ProgramManager::findProgramsBy */ public function testFindProgramsDoNotIncludeDeleted() { $class = 'Ilios\\CoreBundle\\Entity\\Program'; $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 ProgramManager($registry, $class); $manager->findProgramsBy(array('foo' => 'bar')); }