Beispiel #1
0
 /**
  * Initialize Vote with required data.
  *
  * @param Vote     $vote
  * @param User     $user
  * @param Site     $site
  * @param Annuaire $annuaire
  * @param $tracker
  * @param $point
  *
  * @return Vote
  */
 public function initVote(Vote $vote, User $user, Site $site, Annuaire $annuaire, $tracker, $point)
 {
     if ($site->getAnnuaires()->contains($annuaire)) {
         $vote->setUser($user);
         $vote->setSite($site);
         $vote->setAnnuaire($annuaire);
         $vote->setTracker($tracker);
         $vote->setPoint($point);
     } else {
         //@todo Générer une exception !
     }
     return $vote;
 }
Beispiel #2
0
 /**
  * Test getter and setter of Annuaire property.
  *
  * @covers AppBundle\Entity\Vote::setAnnuaire()
  * @covers AppBundle\Entity\Vote::getAnnuaire()
  */
 public function testSetAnnuaire()
 {
     $annuaire = new Annuaire();
     $this->vote->setAnnuaire($annuaire);
     $this->assertEquals($annuaire, $this->vote->getAnnuaire());
 }