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

fixture with a voter

This commit is contained in:
Baptiste Lemoine 2019-11-12 11:55:11 +01:00
parent 130cd313c0
commit f93d235645

View File

@ -14,14 +14,19 @@ class AppPollFixtures extends Fixture {
$owner = new Owner(); $owner = new Owner();
$owner->setEmail( 'tktest@tktest.com' ) $owner->setEmail( 'tktest@tktest.com' )
->setPseudo( 'tk_TEST' ); ->setPseudo( 'tk_TEST' )
->setModifierToken( uniqid() );
$voter = new Owner();
$voter->setEmail( 'testing_vote_people@tktest.com' )
->setPseudo( 'voting_people_TEST' )
->setModifierToken( uniqid() );
// $product = new Product(); // $product = new Product();
$poll = new Poll(); $poll = new Poll();
$poll->setTitle( 'citron ou orange' ); $poll->setTitle( 'citron ou orange' );
$poll->setKind( 'text' ); $poll->setKind( 'text' );
$poll->setDescription( 'votre sorbert préféré' ); $poll->setDescription( 'votre sorbert préféré' );
$poll->setAdminKey( 'dskjfsfdljkdsjlkdsfkjdsjdlkfs' ); $poll->setAdminKey( uniqid() );
$poll->setModificationPolicy( 'nobody' ); $poll->setModificationPolicy( 'nobody' );
$poll->setCreationDate( new \DateTime() ); $poll->setCreationDate( new \DateTime() );
$poll->setExpiracyDate( new \DateTime() ); $poll->setExpiracyDate( new \DateTime() );
@ -54,7 +59,7 @@ class AppPollFixtures extends Fixture {
$poll->setTitle( 'démo sondage de texte 2' ); $poll->setTitle( 'démo sondage de texte 2' );
$poll->setDescription( 'description du sondage 2' ); $poll->setDescription( 'description du sondage 2' );
$poll->setKind( 'date' ); $poll->setKind( 'date' );
$poll->setAdminKey( 'dskjfsfdljkdsjlkdsfkjdsjdlkfs' ); $poll->setAdminKey( uniqid() );
$poll->setModificationPolicy( 'self' ); $poll->setModificationPolicy( 'self' );
$poll->setMailOnComment( true ); $poll->setMailOnComment( true );
$poll->setCreationDate( new \DateTime() ); $poll->setCreationDate( new \DateTime() );
@ -70,7 +75,7 @@ class AppPollFixtures extends Fixture {
$poll->setPassword( md5( 'mot_de_passe_super' ) ); $poll->setPassword( md5( 'mot_de_passe_super' ) );
$poll->setModificationPolicy( 'everybody' ); $poll->setModificationPolicy( 'everybody' );
$poll->setDescription( 'description du sondage' ); $poll->setDescription( 'description du sondage' );
$poll->setAdminKey( 'dskjfsfdljkdsjlkdsfkjdsjdlkfs' ); $poll->setAdminKey( uniqid() );
$poll->setCustomUrl( 'boudoum_podom_podom' ); $poll->setCustomUrl( 'boudoum_podom_podom' );
$poll->setCreationDate( new \DateTime() ); $poll->setCreationDate( new \DateTime() );
$poll->setExpiracyDate( new \DateTime() ); $poll->setExpiracyDate( new \DateTime() );
@ -81,6 +86,7 @@ class AppPollFixtures extends Fixture {
$manager->persist( $poll ); $manager->persist( $poll );
$manager->persist( $owner ); $manager->persist( $owner );
$manager->persist( $voter );
$manager->flush(); $manager->flush();
} }