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