Пример #1
0
 /**
  * Initializes variables to mock an Entity
  */
 protected function mock()
 {
     $this->emMod = $this->getMockBuilder('\\Doctrine\\Common\\Persistence\\ObjectManager')->disableOriginalConstructor()->getMock();
     $this->repository = $this->getMockBuilder('\\Doctrine\\ORM\\EntityRepository')->disableOriginalConstructor()->getMock();
     $this->now = new \DateTime('now');
     $this->user = $this->em->getRepository('BaseBundle:User')->find(2);
     /*mokear una partida*/
     $this->partida = new Partida();
     $this->partida->setAluPorUsuario(20)->setRatio(0.5)->setCreado($this->now)->setFin($this->now->add(new DateInterval('P10D')))->setMaxJugadores(10)->setNombre('test1?A')->setPassword('test')->setExpY(1)->setExpZ(1);
     $this->partida->setIdCreador($this->user)->setMaxOfertas(2)->setTiempoOferta(10);
     /*mokear una oferta*/
     $this->oferta = new Ofertas();
     $this->oferta->setCreado($this->now)->setEstado(0)->setAluBlancaIn(10)->setAluBlancaOut(0)->setAluRojaIn(0)->setAluRojaOut(6)->setIdCreador($this->user)->setIdDestinatario($this->user)->setIdPartida($this->partida);
     /*mokear un log*/
     $this->log = new Log();
     $this->log->setUser($this->user)->setActionId(5)->setFecha($this->now);
 }