Exemplo n.º 1
0
 /**
  * You will need to specify all contact fields that you want to perate with.
  * Please note that custom fields shpuld be prefixed with underscore.
  */
 public function testConfigFields()
 {
     $options = array('appname' => $this->testConfig['appname'], 'apikey' => $this->testConfig['apikey'], 'fields' => $this->testConfig['fields']);
     $i = new Sync($options);
     $expected = $i->getConfigFields();
     $this->assertEquals($expected, $options['fields']);
 }
Exemplo n.º 2
0
 public function testContactFieldOwnerID()
 {
     $data = array('OwnerID' => 1);
     $config = $this->testConfig;
     $config['fields'] = array_keys($data);
     $i = new Sync($config);
     $isdk = $i->getIsdk();
     $contact = new Contact($data);
     $collection = new ContactCollection();
     $collection->create($contact);
     $c = $i->push($collection);
     $read = $c['create']->read();
     $readData = reset($read);
     $expected = $isdk->loadCon($readData->getId(), $i->getConfigFields());
     foreach ($data as $k => $v) {
         $fields = $contact->getData();
         $this->assertEquals($expected[$k], $fields[$k]);
     }
     $isdk->dsDelete('Contact', $readData->getId());
 }