Example #1
0
 public function testSaveAndLoad()
 {
     $name = 'Test Client';
     $client = new Client();
     $client->setName($name);
     $client->setContactPerson_id($this->testPersonId);
     $client->save();
     $id = $client->getId();
     $api_key = $client->getApi_key();
     $this->assertNotEmpty($id);
     $this->assertNotEmpty($api_key);
     $client = new Client($id);
     $this->assertEquals($api_key, $client->getApi_key());
     $client = Client::loadByApiKey($api_key);
     $this->assertEquals($id, $client->getId());
 }