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