function _testOTE() { $DbDomain = DBDomain::GetInstance(); $DbNameserverHost = DBNameserverHost::GetInstance(); // Cleanup previous execution traces try { $this->Module->Request("domain-delete", array("name" => "testeppart.kz")); } catch (Exception $e) { } try { $Domain = $DbDomain->LoadByName('testeppart', 'kz'); $this->Registry->DeleteDomain($Domain); } catch (Exception $e) { } try { $this->Module->Request("domain-delete", array("name" => "newtesteppart.kz")); } catch (Exception $e) { } try { $Domain = $DbDomain->LoadByName('newtesteppart', 'kz'); $this->Registry->DeleteDomain($Domain); } catch (Exception $e) { } // // 1. Create domain // $Contact = $this->Registry->NewContactInstance(CONTACT_TYPE::REGISTRANT); $Contact->SetFieldList($this->contact_fields); $this->Registry->CreateContact($Contact); $Domain = $this->Registry->NewDomainInstance(); $Domain->UserID = 39; $Domain->Name = 'testeppart'; $Domain->Period = 1; $Domain->SetContact($Contact, CONTACT_TYPE::REGISTRANT); $Domain->SetContact($Contact, CONTACT_TYPE::ADMIN); $Domain->SetContact($Contact, CONTACT_TYPE::TECH); $Domain->SetContact($Contact, CONTACT_TYPE::BILLING); $this->Registry->CreateDomain($Domain, $Domain->Period); $NS1 = new NameserverHost('ns1.testeppart.kz', '212.110.212.110'); $this->Registry->CreateNameserver($NS1); $NS2 = new NameserverHost('ns2.testeppart.kz', '212.110.111.111'); $this->Registry->CreateNameserver($NS2); $Changelist = $Domain->GetNameserverChangelist(); $Changelist->Add($NS1); $Changelist->Add($NS2); $this->Registry->UpdateDomainNameservers($Domain, $Changelist); $this->AssertTrue(date('Ymd', $Domain->ExpireDate) == date('Ymd', strtotime('+1 year')) && count($Domain->GetNameserverList()) == 2, 'Create domain'); // Reload domain from Db for correct operations $Domain = $DbDomain->LoadByName('testeppart', 'kz'); $DbNameserverHost->LoadList($Domain->ID); // // 2. Update nameserver host // $nslist = $Domain->GetNameserverList(); $NS2 = $nslist[1]; $NS2->IPAddr = '212.111.110.110'; $this->Registry->UpdateNameserverHost($NS2); $this->assertTrue(true, 'Update nameserver host'); // // 3. Create nameserver host // $Domain4Host = $this->Registry->NewDomainInstance(); $Domain->UserID = 39; $Domain->Name = 'newtesteppart'; $Domain->Period = 1; $Domain->SetContact($Contact, CONTACT_TYPE::REGISTRANT); $this->Registry->CreateDomain($Domain, $Domain->Period); $NS3 = new NameserverHost('ns.newtesteppart.kz', '211.211.211.211'); $this->Registry->CreateNameserverHost($NS3); $this->assertTrue(true, 'Create nameserver host'); // // 4. Add nameserver to domain // $Changelist = $Domain->GetNameserverChangelist(); $Changelist->Add($NS3); $this->Registry->UpdateDomainNameservers($Domain, $Changelist); $this->assertTrue(count($Domain->GetNameserverList()) == 3, 'Add nameserver to domain'); // // 5. Remove nameserver from domain // $nslist = $Domain->GetNameserverList(); $NS1 = $nslist[0]; $Changelist = $Domain->GetNameserverChangelist(); $Changelist->Remove($NS1); $this->Registry->UpdateDomainNameservers($Domain, $Changelist); $this->assertTrue(count($Domain->GetNameserverList()) == 2, 'Remove nameserver from domain'); // // 6. Delete nameserver host // try { $this->Registry->DeleteNameserverHost($NS1); $this->assertTrue(true, 'Delete nameserver host'); } catch (Exception $e) { $this->assertTrue(true, 'Delete nameserver host failed. Don\'t forget to cheat response code'); } // // 7. Update contact // $contact_fields = $Contact->GetFieldList(); $contact_fields['voice'] = '+380-555-7654321'; $this->Registry->UpdateContact($Contact); $this->assertTrue(true, 'Update contact'); // // 8. Start ingoing transfer // $TrnDomain = $this->Registry->NewDomainInstance(); $TrnDomain->Name = 'xyz1'; $TrnDomain->UserID = 39; $this->Registry->TransferRequest($TrnDomain, array('pw' => '123456')); $this->Registry->DeleteDomain($Domain); $this->Registry->DeleteContact($Contact); }