示例#1
0
 /**
  * @covers Ilios\CoreBundle\Entity\Manager\SessionManager::findSessionBy
  */
 public function testFindSessionDoesNotIncludeDeleted()
 {
     $class = 'Ilios\\CoreBundle\\Entity\\Session';
     $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 SessionManager($registry, $class);
     $manager->findSessionBy(array('foo' => 'bar'));
 }