Example #1
0
 function _testPoll()
 {
 	$res = $this->registry->DispatchPendingOperations();
 	var_dump($res);
 	//$domain = DBDomain::GetInstance()->Load(99);
 	//$d = $this->registry->GetRemoteDomain($domain);
 	//var_dump($d);
 }
Example #2
0
        function _testEPP ()
        {
			$Domain = $this->Registry->NewDomainInstance();
			$Domain->Name = 'webta' . rand(1000, 9999);
			
			// check domain
			try
			{
				$ok = $this->Registry->DomainCanBeRegistered($Domain);
				$this->assertTrue($ok, 'Domain available for registration');
			}
			catch (Exception $e)
			{
				return $this->fail('Domain available for registration. Error: ' . $e->getMessage());
			}
			
			////
			// Create contact

			try
			{
				$Registrant = $this->Registry->NewContactInstanceByGroup('generic');
				$Registrant->SetFieldList($this->contact_fields);
				
				$this->Registry->CreateContact($Registrant);
				
				$this->assertTrue(true, 'Create contact');
			}
			catch (Exception $e)
			{
				return $this->fail('Create contact. Error: ' . $e->getMessage());
			}
			
			////
			// Get contact INFO
			
			try
			{
				$RRegistrant = $this->Registry->NewContactInstanceByGroup('generic');
				$RRegistrant->CLID = $Registrant->CLID;
				
				$this->Registry->GetRemoteContact($RRegistrant);
				
				$fields = $Registrant->GetFieldList();
				$rfields = $RRegistrant->GetFieldList();
				ksort($fields);
				ksort($rfields);
				
				$discloses = $Registrant->GetDiscloseList();
				$rdiscloses = $RRegistrant->GetDiscloseList();
				ksort($discloses);
				ksort($rdiscloses);
				
				$this->assertTrue(
					$fields['name'] == $rfields['name'] &&
					$fields['email'] == $rfields['email'] &&
					$fields['voice'] == $rfields['voice'] &&
					$discloses == $rdiscloses, 'Get remote contact');
				
			}
			catch (Exception $e)
			{
				return $this->fail('Get remote contact. Error: ' . $e->getMessage());
			}
			
			try
			{
				$Domain->SetContact($Registrant, CONTACT_TYPE::REGISTRANT);
				$Domain->SetNameserverList(array(
					new Nameserver('ns.hostdad.com'),
					new Nameserver('ns2.hostdad.com')
				));
				
				$this->DBDomain->Save($Domain);
				
				$this->Registry->CreateDomain($Domain, 2, array('comment' => 'abc'));
				$this->assertTrue(true, 'Create domain');
			}
			catch (Exception $e)
			{
				return $this->fail('Create domain. Error: ' . $e->getMessage());
			}
			
			
        	$Obs = new TestRegistryObserver($this->Registry, $this);
        	$this->Registry->AttachObserver($Obs);
			$this->Registry->DispatchPendingOperations();
        }