Ejemplo 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));
 }
Ejemplo 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);
 }
Ejemplo n.º 3
0
 /**
  * @return \WellCommerce\AppBundle\Entity\DelivererInterface
  */
 public function create()
 {
     $deliverer = new Deliverer();
     $deliverer->setProducers(new ArrayCollection());
     return $deliverer;
 }