fixture for a date choice
This commit is contained in:
parent
f93d235645
commit
ffb8b14b53
|
@ -5,6 +5,7 @@ namespace App\DataFixtures;
|
|||
use App\Entity\Choice;
|
||||
use App\Entity\Owner;
|
||||
use App\Entity\Poll;
|
||||
use App\Entity\StackOfVotes;
|
||||
use App\Entity\Vote;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
|
@ -69,12 +70,23 @@ class AppPollFixtures extends Fixture {
|
|||
|
||||
$manager->persist( $poll );
|
||||
|
||||
// voting test with 2 people
|
||||
$stack1 = new StackOfVotes();
|
||||
$stack1->setOwner( $voter )
|
||||
->addVote( $poll->getChoices()[ 0 ] );
|
||||
|
||||
$stack2 = new StackOfVotes();
|
||||
$stack1->setOwner( $owner )->addVote( $poll->getChoices()[ 1 ] );
|
||||
|
||||
$voter->addStackOfVote( $stack1 );
|
||||
$owner->addStackOfVote( $stack2 );
|
||||
|
||||
$poll = new Poll();
|
||||
$poll->setTitle( 'accès restreint sondage de texte' );
|
||||
$poll->setKind( 'text' );
|
||||
$poll->setPassword( md5( 'mot_de_passe_super' ) );
|
||||
$poll->setModificationPolicy( 'everybody' );
|
||||
$poll->setDescription( 'description du sondage' );
|
||||
$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->setCreationDate( new \DateTime() );
|
||||
|
|
Loading…
Reference in New Issue