public function testGetPhoneNumbers()
 {
     $entity = new Customer();
     $contact = $this->getMockBuilder('OroCRM\\Bundle\\ContactBundle\\Entity\\Contact')->disableOriginalConstructor()->getMock();
     $entity->setContact($contact);
     $this->rootProvider->expects($this->once())->method('getPhoneNumbers')->with($this->identicalTo($contact))->will($this->returnValue([['123-123', $contact], ['456-456', $contact]]));
     $this->assertEquals([['123-123', $contact], ['456-456', $contact]], $this->provider->getPhoneNumbers($entity));
 }
Exemple #2
0
 protected function setContact(Customer $object, array $data, $format = null, array $context = array())
 {
     $data['contact'] = $this->formatContactData($data);
     /** @var Contact $contact */
     $contact = $this->denormalizeObject($data, 'contact', ContactNormalizer::CONTACT_TYPE, $format, $context);
     if ($contact) {
         $contact->setBirthday($object->getBirthday());
         $object->setContact($contact);
     }
     $this->setAddresses($object, $data, $format, $context);
 }