/**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $user = new User();
     $user->setUsername('*****@*****.**')->setEmail('*****@*****.**');
     $user->setFirstName('Firstname');
     $user->setLastName('Lastname');
     $user->setPhone('0000000000');
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($user);
     $user->setPassword($encoder->encodePassword('coderdojo', $user->getSalt()));
     $manager->persist($user);
     $manager->flush();
     $this->addReference('user', $user);
 }
 /**
  * @test
  */
 public function it_should_return_constructor_data()
 {
     $event1 = $this->createDojoEventMock();
     $event2 = $this->createDojoEventMock();
     $this->dojo->addDojo($event1);
     $this->dojo->addDojo($event2);
     $this->assertSame('chris', $this->dojo->getName());
     $this->assertSame('street', $this->dojo->getStreet());
     $this->assertSame('10', $this->dojo->getHousenumber());
     $this->assertSame('1234aa', $this->dojo->getPostalcode());
     $this->assertSame('city', $this->dojo->getCity());
     $this->assertSame('facebook', $this->dojo->getFacebook());
     $this->assertSame('twitter', $this->dojo->getTwitter());
     $this->assertSame('website', $this->dojo->getWebsite());
     $this->assertSame('location', $this->dojo->getLocation());
     $this->assertSame('organiser', $this->dojo->getOrganiser());
     $this->assertCount(2, $this->dojo->getDojos());
     $this->dojo->removeDojo($event1);
     $this->assertCount(1, $this->dojo->getDojos());
 }
 /**
  * Serialize dojo manually due to FosUserBundle adding password and salt
  * @TODO: Seperate dojo from user account
  *
  * @param User $dojo
  * @return array
  */
 private function serializeDojo(User $dojo)
 {
     return ["id" => $dojo->getId(), "email" => $dojo->getEmail(), "name" => $dojo->getName(), "location" => $dojo->getLocation(), "street" => $dojo->getStreet(), "housenumber" => $dojo->getHousenumber(), "postalcode" => $dojo->getPostalcode(), "city" => $dojo->getCity(), "lat" => $dojo->getLat(), "long" => $dojo->getLong(), "facebook" => $dojo->getFacebook(), "twitter" => $dojo->getTwitter(), "website" => $dojo->getFacebook()];
 }