Пример #1
0
 /**
  * @before
  */
 public function insertUsers()
 {
     $em = $this->container['doctrine_orm.entity_manager'];
     $faker = \Faker\Factory::create();
     $phone = new Phone();
     $phone->setNumber('4792030815');
     $user = new User();
     $user->setName($faker->name);
     $user->setEmail(new Email('*****@*****.**'));
     $user->setMobile($phone);
     $em->persist($user);
     $em->flush();
     $em->clear();
 }
Пример #2
0
 /**
  * @before
  */
 public function insertUsers()
 {
     $em = $this->container['doctrine_orm.entity_manager'];
     $state = new State();
     $state->setName('Santa Catarina');
     $city = new City();
     $city->setName('Florianopolis');
     $city->setState($state);
     $address = new Address();
     $address->setCity($city);
     $user = new User();
     $user->setAddress($address);
     $em->persist($user);
     $em->flush();
     $em->clear();
 }