public function testValidationPassesIfEnabledIsNull() { $entity = new Contact(); $entity->setEnabled(null); $entity->translate('en')->setName('Test'); $entity->translate('en')->setEmail('*****@*****.**'); $entity->mergeNewTranslations(); $errors = $this->validator->validate($entity); $this->assertEquals(0, count($errors)); $this->assertFalse($entity->getEnabled()); }
/** * {@inheritDoc} */ public function load(ObjectManager $manager) { $contact = new Contact(); $contact->setEnabled(1); $contact->translate('en')->setName('Sales department'); $contact->translate('en')->setEmail('*****@*****.**'); $contact->translate('en')->setPhone('555 123-345-678'); $contact->translate('en')->setBusinessHours($this->getBusinessHours()); $contact->mergeNewTranslations(); $manager->persist($contact); $manager->flush(); $this->setReference('contact', $contact); }