예제 #1
0
 /**
  * @covers Ilios\CoreBundle\Entity\Manager\ProgramYearManager::findProgramYearBy
  */
 public function testFindProgramYearDoesNotIncludeDeleted()
 {
     $class = 'Ilios\\CoreBundle\\Entity\\ProgramYear';
     $em = m::mock('Doctrine\\ORM\\EntityManager');
     $repository = m::mock('Doctrine\\ORM\\Repository')->shouldReceive('findOneBy')->with(array('foo' => 'bar', 'deleted' => false), null)->mock();
     $registry = m::mock('Doctrine\\Bundle\\DoctrineBundle\\Registry')->shouldReceive('getManagerForClass')->andReturn($em)->shouldReceive('getRepository')->andReturn($repository)->mock();
     $manager = new ProgramYearManager($registry, $class);
     $manager->findProgramYearBy(array('foo' => 'bar'));
 }