1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00

better fixtures

This commit is contained in:
Baptiste Lemoine 2020-01-30 11:49:36 +01:00
parent 7566c75af8
commit b3bdeb0d4a

View File

@ -47,7 +47,7 @@ class AppPollFixtures extends Fixture {
$choiceA = new Choice();
$choiceA->setName( 'citron' );
$choiceB = new Choice();
$choiceA->setName( 'orange' );
$choiceB->setName( 'orange' );
$poll
->addChoice( $choiceA )
@ -129,47 +129,6 @@ class AppPollFixtures extends Fixture {
// voting test with 2 people
// $stack1 = new StackOfVotes();
// $vote0 = new Vote();
// $vote0->setChoice( $poll->getChoices()[ 0 ] );
// $stack1->setOwner( $voter )
// ->addVote( $vote0 );
//
// $stack2 = new StackOfVotes();
// $vote1 = new Vote();
// $vote1
// ->setChoice( $poll->getChoices()[ 1 ] );
// $stack1
// ->setOwner( $owner )
// ->addVote( $vote1 );
//
//
// $voter->addStackOfVote( $stack1 );
// $owner->addStackOfVote( $stack2 );
//
// $poll = new Poll();
// $poll->setTitle( 'accès restreint sondage de texte' );
// $poll ;
// $poll->setPassword( md5( 'mot_de_passe_super' ) );
// $poll->setModificationPolicy( 'everybody' );
// $poll->setDescription( 'description du sondage a accès restreint. le mot de passe est mot_de_passe_super' );
// $poll->setAdminKey( uniqid() );
// $poll->setCustomUrl( 'boudoum_podom_podom' );
//
// $poll ;
// $poll->setMailOnComment( true );
// $poll->setMailOnVote( true );
// $poll->setOwner( $owner );
// $owner->addPoll( $poll );
//
// $manager->persist( $vote1 );
// $manager->persist( $vote0 );
// $manager->persist( $stack1 );
// $manager->persist( $stack2 );
// $manager->persist( $poll );
// $manager->persist( $owner );
// $manager->persist( $voter );
// poll with date type
$poll = new Poll();
@ -187,7 +146,9 @@ class AppPollFixtures extends Fixture {
->setOwner( $owner )
->addChoice( $choice )
->addChoice( $choice2 )
->addChoice( $choice3 )
->setModificationPolicy( 'self' );
$manager->persist( $poll );
// poll with cartoon choices
$poll = new Poll();
@ -205,6 +166,17 @@ class AppPollFixtures extends Fixture {
"Digimon",
] );
$someoneComment = new Comment();
$someoneComment
->setText( "allez boumbo!" )
->setOwner( $commenterMan );
$poll->addComment( $someoneComment );
$someoneComment2 = new Comment();
$someoneComment2
->setText( "je suis pour la team rocket de digimon" )
->setOwner( $owner );
$poll->addComment( $someoneComment2 );
$manager->persist( $poll );
$stack = new StackOfVotes();