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

advance on fixtures

This commit is contained in:
Tykayn 2021-04-21 11:22:50 +02:00 committed by tykayn
parent b6ca330826
commit 108cc473e4

View File

@ -21,61 +21,65 @@ class CommentFixtures extends Fixture {
// comment on "citron ou orange" // comment on "citron ou orange"
$pollCitronOrange = $emPoll->findOneByCustomUrl( 'citron' ); $pollCitronOrange = $emPoll->findOneByCustomUrl( 'citron' );
$comment = new Comment(); if ( $pollCitronOrange ) {
$comment->setOwner( $commenterMan )
->setPseudo( 'the indécis people' )
->setText( 'quelle indécision wololo! finalement citron. heu non orange. AAAAh!' );
$pollCitronOrange->addComment( $comment );
$manager->persist( $comment );
$manager->persist( $pollCitronOrange );
$manager->persist( $commenterMan );
$manager->flush();
// comment on "démo sondage de texte avec deux commentaires" $comment = new Comment();
$poll = $emPoll->find( 2 ); $comment->setOwner( $commenterMan )
$comment = new Comment(); ->setPseudo( 'the indécis people' )
$comment->setOwner( $commenterMan2 ) ->setText( 'quelle indécision wololo! finalement citron. heu non orange. AAAAh!' );
->setPseudo( 'The Hayroule king' ) $pollCitronOrange->addComment( $comment );
->setText( 'il est écrit Squalala.' ); $manager->persist( $comment );
$pollCitronOrange->addComment( $comment ); $manager->persist( $pollCitronOrange );
$manager->persist( $comment ); $manager->persist( $commenterMan );
$manager->persist( $poll ); $manager->flush();
$manager->persist( $commenterMan2 );
$manager->flush();
$comment = new Comment(); // comment on "démo sondage de texte avec deux commentaires"
$comment->setOwner( $commenterMan ) $poll = $emPoll->find( 2 );
->setPseudo( 'The Hayroule king' ) $comment = new Comment();
->setText( "Zelda. Orange." ); $comment->setOwner( $commenterMan2 )
$pollCitronOrange->addComment( $comment ); ->setPseudo( 'The Hayroule king' )
$manager->persist( $comment ); ->setText( 'il est écrit Squalala.' );
$manager->persist( $poll ); $pollCitronOrange->addComment( $comment );
$manager->persist( $commenterMan ); $manager->persist( $comment );
$manager->flush(); $manager->persist( $poll );
$manager->persist( $commenterMan2 );
$manager->flush();
$comment = new Comment();
$comment->setOwner( $commenterMan )
->setPseudo( 'The Hayroule king' )
->setText( "Zelda. Orange." );
$pollCitronOrange->addComment( $comment );
$manager->persist( $comment );
$manager->persist( $poll );
$manager->persist( $commenterMan );
$manager->flush();
// comment on "c'est pour aujourdhui ou pour demain" // comment on "c'est pour aujourdhui ou pour demain"
$poll = $emPoll->find( 3 ); $poll = $emPoll->find( 3 );
$comment = new Comment(); $comment = new Comment();
$comment->setOwner( $commenterMan ) $comment->setOwner( $commenterMan )
->setPseudo( 'The Hayroule king' ) ->setPseudo( 'The Hayroule king' )
->setText( "va pour demain" ); ->setText( "va pour demain" );
$pollCitronOrange->addComment( $comment ); $pollCitronOrange->addComment( $comment );
$manager->persist( $comment ); $manager->persist( $comment );
$manager->persist( $poll ); $manager->persist( $poll );
$manager->persist( $commenterMan ); $manager->persist( $commenterMan );
$manager->flush(); $manager->flush();
// comment on "dessin animé préféré" // comment on "dessin animé préféré"
$poll = $emPoll->find( 4 ); $poll = $emPoll->find( 4 );
$comment = new Comment(); $comment = new Comment();
$comment->setOwner( $commenterMan2 ) $comment->setOwner( $commenterMan2 )
->setPseudo( 'The Hayroule king' ) ->setPseudo( 'The Hayroule king' )
->setText( "Ceci est un commentaire de fixture créé avec le CipherBliss poweur." ); ->setText( "Ceci est un commentaire de fixture créé avec le CipherBliss poweur." );
$pollCitronOrange->addComment( $comment ); $pollCitronOrange->addComment( $comment );
$manager->persist( $comment ); $manager->persist( $comment );
$manager->persist( $poll ); $manager->persist( $poll );
$manager->persist( $commenterMan2 ); $manager->persist( $commenterMan2 );
}
$manager->flush(); $manager->flush();
} }
} }