Exemplo n.º 1
0
 public function testEntityRequiresNonEmptyName()
 {
     $entity = new Deliverer();
     $entity->translate('en')->setName('');
     $entity->mergeNewTranslations();
     $errors = $this->validator->validate($entity);
     $this->assertEquals(1, count($errors));
 }
Exemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $fakerGenerator = $this->getFakerGenerator();
     $deliverer = new Deliverer();
     $name = $fakerGenerator->company;
     $deliverer->translate('en')->setName($name);
     $deliverer->mergeNewTranslations();
     $manager->persist($deliverer);
     $manager->flush();
     $this->setReference('deliverer', $deliverer);
 }
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     if (!$this->isEnabled()) {
         return;
     }
     $fakerGenerator = $this->getFakerGenerator();
     $deliverer = new Deliverer();
     $name = $fakerGenerator->company;
     $deliverer->translate($this->getDefaultLocale())->setName($name);
     $deliverer->mergeNewTranslations();
     $manager->persist($deliverer);
     $manager->flush();
     $this->setReference('deliverer', $deliverer);
 }