/** * @covers Ilios\CoreBundle\Entity\Manager\ReportManager::findReportsBy */ public function testFindReportsDoNotIncludeDeleted() { $class = 'Ilios\\CoreBundle\\Entity\\Report'; $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 ReportManager($registry, $class); $manager->findReportsBy(array('foo' => 'bar')); }
/** * @param Registry $em * @param string $class * @param FormFactoryInterface $formFactory */ public function __construct(Registry $em, $class, FormFactoryInterface $formFactory) { $this->formFactory = $formFactory; parent::__construct($em, $class); }