Note that there are some explanatory texts on larger screens.

plurals
  1. POFOSUserBundle Not Setting Salt In DoctrineFixtures
    primarykey
    data
    text
    <p>I'm trying to load some users into my database for testing using the DoctrineFixturesBundle. I have done alot of searching here on StackOverflow and have found alot about other issues. None seem to have my answer though. I'm loading my users in using the FOS User Manager. Below is my fixture class.</p> <pre><code>namespace Kandidly\UserBundle\DataFixtures; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; class LoadUserData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface { private $container; /** * {@inheritDoc} */ public function load(ObjectManager $manager) { $userManager = $this-&gt;container-&gt;get('fos_user.user_manager'); $user1 = $userManager-&gt;createUser(); $user1-&gt;setFirstName('Admin'); $user1-&gt;setLastName('User'); $user1-&gt;setCity('Somewhere'); $user1-&gt;setState('TN'); $user1-&gt;setUsername('admin'); $user1-&gt;setEmail('admin@example.com'); $user1-&gt;setPlainPassword('admin'); $user1-&gt;setEnabled(true); $user1-&gt;setRoles( array( 'ROLE_ADMIN' ) ); $user2 = $userManager-&gt;createUser(); $user2-&gt;setFirstName('Normal'); $user2-&gt;setLastName('User'); $user2-&gt;setCity('Another'); $user2-&gt;setState('CA'); $user2-&gt;setUsername('user'); $user2-&gt;setEmail('use@example.com'); $user2-&gt;setPlainPassword('user'); $user2-&gt;setEnabled(true); $user2-&gt;setRoles( array( 'ROLE_USER' ) ); $userManager-&gt;updateUser($user1); $userManager-&gt;updateUser($user2); $this-&gt;addReference('admin-user', $user1); } /** * Get the order of this fixture * * @return integer */ function getOrder() { return 1; } /** * Sets the Container. * * @param ContainerInterface|null $container A ContainerInterface instance or null * * @api */ public function setContainer(ContainerInterface $container = null) { $this-&gt;container = $container; } } </code></pre> <p>However, when I run the fixtures, I get an error that says the salt is not being set. Can anyone help?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload