/**
  * @covers Ilios\CoreBundle\Entity\Manager\ProgramYearManager::findProgramYearsBy
  */
 public function testFindProgramYearsDoNotIncludeDeleted()
 {
     $class = 'Ilios\\CoreBundle\\Entity\\ProgramYear';
     $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 ProgramYearManager($registry, $class);
     $manager->findProgramYearsBy(array('foo' => 'bar'));
 }
Beispiel #2
0
 /**
  * @param Registry $em
  * @param string $class
  * @param FormFactoryInterface $formFactory
  */
 public function __construct(Registry $em, $class, FormFactoryInterface $formFactory)
 {
     $this->formFactory = $formFactory;
     parent::__construct($em, $class);
 }