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:
parent
7566c75af8
commit
b3bdeb0d4a
@ -47,7 +47,7 @@ class AppPollFixtures extends Fixture {
|
|||||||
$choiceA = new Choice();
|
$choiceA = new Choice();
|
||||||
$choiceA->setName( 'citron' );
|
$choiceA->setName( 'citron' );
|
||||||
$choiceB = new Choice();
|
$choiceB = new Choice();
|
||||||
$choiceA->setName( 'orange' );
|
$choiceB->setName( 'orange' );
|
||||||
|
|
||||||
$poll
|
$poll
|
||||||
->addChoice( $choiceA )
|
->addChoice( $choiceA )
|
||||||
@ -129,47 +129,6 @@ class AppPollFixtures extends Fixture {
|
|||||||
|
|
||||||
|
|
||||||
// voting test with 2 people
|
// 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 with date type
|
||||||
$poll = new Poll();
|
$poll = new Poll();
|
||||||
@ -187,7 +146,9 @@ class AppPollFixtures extends Fixture {
|
|||||||
->setOwner( $owner )
|
->setOwner( $owner )
|
||||||
->addChoice( $choice )
|
->addChoice( $choice )
|
||||||
->addChoice( $choice2 )
|
->addChoice( $choice2 )
|
||||||
|
->addChoice( $choice3 )
|
||||||
->setModificationPolicy( 'self' );
|
->setModificationPolicy( 'self' );
|
||||||
|
$manager->persist( $poll );
|
||||||
|
|
||||||
// poll with cartoon choices
|
// poll with cartoon choices
|
||||||
$poll = new Poll();
|
$poll = new Poll();
|
||||||
@ -205,6 +166,17 @@ class AppPollFixtures extends Fixture {
|
|||||||
"Digimon",
|
"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 );
|
$manager->persist( $poll );
|
||||||
|
|
||||||
$stack = new StackOfVotes();
|
$stack = new StackOfVotes();
|
||||||
|
Loading…
Reference in New Issue
Block a user