2015-02-08 23:05:51 +01:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 01:30:12 +01:00
|
|
|
namespace Wallabag\DataFixtures;
|
2015-02-08 23:05:51 +01:00
|
|
|
|
2018-11-26 20:00:01 +01:00
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
2020-06-15 08:25:59 +02:00
|
|
|
use Doctrine\Persistence\ObjectManager;
|
2024-02-19 01:30:12 +01:00
|
|
|
use Wallabag\Entity\User;
|
2015-02-08 23:05:51 +01:00
|
|
|
|
2018-11-26 20:00:01 +01:00
|
|
|
class UserFixtures extends Fixture
|
2015-02-08 23:05:51 +01:00
|
|
|
{
|
|
|
|
public function load(ObjectManager $manager)
|
|
|
|
{
|
|
|
|
$userAdmin = new User();
|
2015-02-10 22:32:42 +01:00
|
|
|
$userAdmin->setName('Big boss');
|
|
|
|
$userAdmin->setEmail('bigboss@wallabag.org');
|
2015-02-08 23:05:51 +01:00
|
|
|
$userAdmin->setUsername('admin');
|
2015-09-29 14:31:52 +02:00
|
|
|
$userAdmin->setPlainPassword('mypassword');
|
2015-08-18 11:08:45 +02:00
|
|
|
$userAdmin->setEnabled(true);
|
2015-09-29 14:31:52 +02:00
|
|
|
$userAdmin->addRole('ROLE_SUPER_ADMIN');
|
2015-02-08 23:05:51 +01:00
|
|
|
|
|
|
|
$manager->persist($userAdmin);
|
|
|
|
|
|
|
|
$this->addReference('admin-user', $userAdmin);
|
2015-02-10 22:32:42 +01:00
|
|
|
|
|
|
|
$bobUser = new User();
|
|
|
|
$bobUser->setName('Bobby');
|
|
|
|
$bobUser->setEmail('bobby@wallabag.org');
|
|
|
|
$bobUser->setUsername('bob');
|
2015-09-29 14:31:52 +02:00
|
|
|
$bobUser->setPlainPassword('mypassword');
|
2015-08-18 11:08:45 +02:00
|
|
|
$bobUser->setEnabled(true);
|
2015-02-10 22:32:42 +01:00
|
|
|
|
|
|
|
$manager->persist($bobUser);
|
|
|
|
|
|
|
|
$this->addReference('bob-user', $bobUser);
|
|
|
|
|
2016-01-09 14:34:49 +01:00
|
|
|
$emptyUser = new User();
|
|
|
|
$emptyUser->setName('Empty');
|
|
|
|
$emptyUser->setEmail('empty@wallabag.org');
|
|
|
|
$emptyUser->setUsername('empty');
|
|
|
|
$emptyUser->setPlainPassword('mypassword');
|
|
|
|
$emptyUser->setEnabled(true);
|
|
|
|
|
|
|
|
$manager->persist($emptyUser);
|
|
|
|
|
|
|
|
$this->addReference('empty-user', $emptyUser);
|
|
|
|
|
2015-02-10 22:32:42 +01:00
|
|
|
$manager->flush();
|
2015-02-08 23:05:51 +01:00
|
|
|
}
|
|
|
|
}
|