public function testCommand()
 {
     $command = new TransferDomainCommand($this->domain, "foo", $this->contact, Bool::true(), Bool::false());
     $build = $command->getRequestData();
     $this->assertTrue(is_array($build));
     $this->assertArrayHasKey('domainName', $build);
     $this->assertEquals('example.com', $build['domainName']);
     $this->assertArrayHasKey('authInfo', $build);
     $this->assertEquals('foo', $build['authInfo']);
     $this->assertArrayHasKey('firstname', $build);
     $this->assertEquals('foo', $build['firstname']);
     $this->assertArrayHasKey('lastname', $build);
     $this->assertEquals('bar', $build['lastname']);
     $this->assertArrayHasKey('organisation', $build);
     $this->assertEquals('Foo Pty Ltd', $build['organisation']);
     $this->assertArrayHasKey('address', $build);
     $this->assertTrue(is_array($build['address']));
     $this->assertArrayHasKey(0, $build['address']);
     $this->assertEquals('Suite 1', $build['address'][0]);
     $this->assertArrayHasKey(1, $build['address']);
     $this->assertEquals('Level 1', $build['address'][1]);
     $this->assertArrayHasKey(2, $build['address']);
     $this->assertEquals('Foo Street', $build['address'][2]);
     $this->assertArrayHasKey('suburb', $build);
     $this->assertEquals('foobar', $build['suburb']);
     $this->assertArrayHasKey('state', $build);
     $this->assertEquals('state', $build['state']);
     $this->assertArrayHasKey('country', $build);
     $this->assertEquals('AU', $build['country']);
     $this->assertArrayHasKey('postcode', $build);
     $this->assertEquals('postcode', $build['postcode']);
     $this->assertArrayHasKey('phone', $build);
     $this->assertEquals('+61.111111111', $build['phone']);
     $this->assertArrayHasKey('fax', $build);
     $this->assertEquals('+61.111111112', $build['fax']);
     $this->assertArrayHasKey('email', $build);
     $this->assertEquals('*****@*****.**', $build['email']);
     $this->assertArrayHasKey('idProtect', $build);
     $this->assertEquals('Y', $build['idProtect']);
     $this->assertArrayHasKey('doRenewal', $build);
     $this->assertEquals('0', $build['doRenewal']);
 }
 public function isHostsCapable()
 {
     return Bool::convert($this->response->isHostsCapable);
 }
 public function isAutoRenewEnabled()
 {
     return Bool::convert($this->response->autoRenew);
 }
 public function getRequestData()
 {
     return array('domainName' => $this->domainName->getName(), 'years' => $this->years->getYears(), 'nameServers' => $this->nameServers->getDomainNames(), 'idProtect' => $this->idProtect->isTrue() ? 'Y' : '', 'registrant_firstname' => $this->registrant_contact->getFirstname(), 'registrant_lastname' => $this->registrant_contact->getLastname(), 'registrant_organisation' => $this->registrant_contact->getOrganisation(), 'registrant_address' => array($this->registrant_contact->getAddress1(), $this->registrant_contact->getAddress2(), $this->registrant_contact->getAddress3()), 'registrant_suburb' => $this->registrant_contact->getSuburb(), 'registrant_state' => $this->registrant_contact->getState(), 'registrant_country' => $this->registrant_contact->getCountryCode(), 'registrant_postcode' => $this->registrant_contact->getPostcode(), 'registrant_phone' => $this->registrant_contact->getPhoneNumber(), 'registrant_fax' => $this->registrant_contact->getFaxNumber(), 'registrant_email' => $this->registrant_contact->getEmailAddress(), 'billing_firstname' => $this->billing_contact->getFirstname(), 'billing_lastname' => $this->billing_contact->getLastname(), 'billing_organisation' => $this->billing_contact->getOrganisation(), 'billing_address' => array($this->billing_contact->getAddress1(), $this->billing_contact->getAddress2(), $this->billing_contact->getAddress3()), 'billing_suburb' => $this->billing_contact->getSuburb(), 'billing_state' => $this->billing_contact->getState(), 'billing_country' => $this->billing_contact->getCountryCode(), 'billing_postcode' => $this->billing_contact->getPostcode(), 'billing_phone' => $this->billing_contact->getPhoneNumber(), 'billing_fax' => $this->billing_contact->getFaxNumber(), 'billing_email' => $this->billing_contact->getEmailAddress(), 'admin_firstname' => $this->admin_contact->getFirstname(), 'admin_lastname' => $this->admin_contact->getLastname(), 'admin_organisation' => $this->admin_contact->getOrganisation(), 'admin_address' => array($this->admin_contact->getAddress1(), $this->admin_contact->getAddress2(), $this->admin_contact->getAddress3()), 'admin_suburb' => $this->admin_contact->getSuburb(), 'admin_state' => $this->admin_contact->getState(), 'admin_country' => $this->admin_contact->getCountryCode(), 'admin_postcode' => $this->admin_contact->getPostcode(), 'admin_phone' => $this->admin_contact->getPhoneNumber(), 'admin_fax' => $this->admin_contact->getFaxNumber(), 'admin_email' => $this->admin_contact->getEmailAddress(), 'technical_firstname' => $this->technical_contact->getFirstname(), 'technical_lastname' => $this->technical_contact->getLastname(), 'technical_organisation' => $this->technical_contact->getOrganisation(), 'technical_address' => array($this->technical_contact->getAddress1(), $this->technical_contact->getAddress2(), $this->technical_contact->getAddress3()), 'technical_suburb' => $this->technical_contact->getSuburb(), 'technical_state' => $this->technical_contact->getState(), 'technical_country' => $this->technical_contact->getCountryCode(), 'technical_postcode' => $this->technical_contact->getPostcode(), 'technical_phone' => $this->technical_contact->getPhoneNumber(), 'technical_fax' => $this->technical_contact->getFaxNumber(), 'technical_email' => $this->technical_contact->getEmailAddress());
 }
 public function testCommand()
 {
     $command = new DomainRegisterCommand($this->domain, $this->years, $this->nameServers, Bool::true(), $this->contact, $this->contact, $this->contact, $this->contact);
     $build = $command->getRequestData();
     $this->assertTrue(is_array($build));
     $this->assertArrayHasKey('domainName', $build);
     $this->assertEquals('example.com', $build['domainName']);
     $this->assertArrayHasKey('years', $build);
     $this->assertEquals(1, $build['years']);
     $this->assertArrayHasKey('nameServers', $build);
     $this->assertTrue(is_array($build['nameServers']));
     $this->assertArrayHasKey(0, $build['nameServers']);
     $this->assertEquals('ns1.foo.com', $build['nameServers'][0]);
     $this->assertArrayHasKey(1, $build['nameServers']);
     $this->assertEquals('ns2.foo.com', $build['nameServers'][1]);
     $this->assertArrayHasKey('idProtect', $build);
     $this->assertEquals('Y', $build['idProtect']);
     $this->assertArrayHasKey('registrant_firstname', $build);
     $this->assertEquals('foo', $build['registrant_firstname']);
     $this->assertArrayHasKey('registrant_lastname', $build);
     $this->assertEquals('bar', $build['registrant_lastname']);
     $this->assertArrayHasKey('registrant_organisation', $build);
     $this->assertEquals('Foo Pty Ltd', $build['registrant_organisation']);
     $this->assertArrayHasKey('registrant_address', $build);
     $this->assertTrue(is_array($build['registrant_address']));
     $this->assertArrayHasKey(0, $build['registrant_address']);
     $this->assertEquals('Suite 1', $build['registrant_address'][0]);
     $this->assertArrayHasKey(1, $build['registrant_address']);
     $this->assertEquals('Level 1', $build['registrant_address'][1]);
     $this->assertArrayHasKey(2, $build['registrant_address']);
     $this->assertEquals('Foo Street', $build['registrant_address'][2]);
     $this->assertArrayHasKey('registrant_suburb', $build);
     $this->assertEquals('foobar', $build['registrant_suburb']);
     $this->assertArrayHasKey('registrant_state', $build);
     $this->assertEquals('state', $build['registrant_state']);
     $this->assertArrayHasKey('registrant_country', $build);
     $this->assertEquals('AU', $build['registrant_country']);
     $this->assertArrayHasKey('registrant_postcode', $build);
     $this->assertEquals('postcode', $build['registrant_postcode']);
     $this->assertArrayHasKey('registrant_phone', $build);
     $this->assertEquals('+61.111111111', $build['registrant_phone']);
     $this->assertArrayHasKey('registrant_fax', $build);
     $this->assertEquals('+61.111111112', $build['registrant_fax']);
     $this->assertArrayHasKey('registrant_email', $build);
     $this->assertEquals('*****@*****.**', $build['registrant_email']);
     $this->assertArrayHasKey('billing_firstname', $build);
     $this->assertEquals('foo', $build['billing_firstname']);
     $this->assertArrayHasKey('billing_lastname', $build);
     $this->assertEquals('bar', $build['billing_lastname']);
     $this->assertArrayHasKey('billing_organisation', $build);
     $this->assertEquals('Foo Pty Ltd', $build['billing_organisation']);
     $this->assertArrayHasKey('billing_address', $build);
     $this->assertTrue(is_array($build['billing_address']));
     $this->assertArrayHasKey(0, $build['billing_address']);
     $this->assertEquals('Suite 1', $build['billing_address'][0]);
     $this->assertArrayHasKey(1, $build['billing_address']);
     $this->assertEquals('Level 1', $build['billing_address'][1]);
     $this->assertArrayHasKey(2, $build['billing_address']);
     $this->assertEquals('Foo Street', $build['billing_address'][2]);
     $this->assertArrayHasKey('billing_suburb', $build);
     $this->assertEquals('foobar', $build['billing_suburb']);
     $this->assertArrayHasKey('billing_state', $build);
     $this->assertEquals('state', $build['billing_state']);
     $this->assertArrayHasKey('billing_country', $build);
     $this->assertEquals('AU', $build['billing_country']);
     $this->assertArrayHasKey('billing_postcode', $build);
     $this->assertEquals('postcode', $build['billing_postcode']);
     $this->assertArrayHasKey('billing_phone', $build);
     $this->assertEquals('+61.111111111', $build['billing_phone']);
     $this->assertArrayHasKey('billing_fax', $build);
     $this->assertEquals('+61.111111112', $build['billing_fax']);
     $this->assertArrayHasKey('billing_email', $build);
     $this->assertEquals('*****@*****.**', $build['billing_email']);
     $this->assertArrayHasKey('admin_firstname', $build);
     $this->assertEquals('foo', $build['admin_firstname']);
     $this->assertArrayHasKey('admin_lastname', $build);
     $this->assertEquals('bar', $build['admin_lastname']);
     $this->assertArrayHasKey('admin_organisation', $build);
     $this->assertEquals('Foo Pty Ltd', $build['admin_organisation']);
     $this->assertArrayHasKey('admin_address', $build);
     $this->assertTrue(is_array($build['admin_address']));
     $this->assertArrayHasKey(0, $build['admin_address']);
     $this->assertEquals('Suite 1', $build['admin_address'][0]);
     $this->assertArrayHasKey(1, $build['admin_address']);
     $this->assertEquals('Level 1', $build['admin_address'][1]);
     $this->assertArrayHasKey(2, $build['admin_address']);
     $this->assertEquals('Foo Street', $build['admin_address'][2]);
     $this->assertArrayHasKey('admin_suburb', $build);
     $this->assertEquals('foobar', $build['admin_suburb']);
     $this->assertArrayHasKey('admin_state', $build);
     $this->assertEquals('state', $build['admin_state']);
     $this->assertArrayHasKey('admin_country', $build);
     $this->assertEquals('AU', $build['admin_country']);
     $this->assertArrayHasKey('admin_postcode', $build);
     $this->assertEquals('postcode', $build['admin_postcode']);
     $this->assertArrayHasKey('admin_phone', $build);
     $this->assertEquals('+61.111111111', $build['admin_phone']);
     $this->assertArrayHasKey('admin_fax', $build);
     $this->assertEquals('+61.111111112', $build['admin_fax']);
     $this->assertArrayHasKey('admin_email', $build);
     $this->assertEquals('*****@*****.**', $build['admin_email']);
     $this->assertArrayHasKey('technical_firstname', $build);
     $this->assertEquals('foo', $build['technical_firstname']);
     $this->assertArrayHasKey('technical_lastname', $build);
     $this->assertEquals('bar', $build['technical_lastname']);
     $this->assertArrayHasKey('technical_organisation', $build);
     $this->assertEquals('Foo Pty Ltd', $build['technical_organisation']);
     $this->assertArrayHasKey('technical_address', $build);
     $this->assertTrue(is_array($build['technical_address']));
     $this->assertArrayHasKey(0, $build['technical_address']);
     $this->assertEquals('Suite 1', $build['technical_address'][0]);
     $this->assertArrayHasKey(1, $build['technical_address']);
     $this->assertEquals('Level 1', $build['technical_address'][1]);
     $this->assertArrayHasKey(2, $build['technical_address']);
     $this->assertEquals('Foo Street', $build['technical_address'][2]);
     $this->assertArrayHasKey('technical_suburb', $build);
     $this->assertEquals('foobar', $build['technical_suburb']);
     $this->assertArrayHasKey('technical_state', $build);
     $this->assertEquals('state', $build['technical_state']);
     $this->assertArrayHasKey('technical_country', $build);
     $this->assertEquals('AU', $build['technical_country']);
     $this->assertArrayHasKey('technical_postcode', $build);
     $this->assertEquals('postcode', $build['technical_postcode']);
     $this->assertArrayHasKey('technical_phone', $build);
     $this->assertEquals('+61.111111111', $build['technical_phone']);
     $this->assertArrayHasKey('technical_fax', $build);
     $this->assertEquals('+61.111111112', $build['technical_fax']);
     $this->assertArrayHasKey('technical_email', $build);
     $this->assertEquals('*****@*****.**', $build['technical_email']);
 }
 public function getRequestData()
 {
     return array('domainName' => $this->domainName->getName(), 'authInfo' => $this->authInfo, 'firstname' => $this->contact->getFirstname(), 'lastname' => $this->contact->getLastname(), 'organisation' => $this->contact->getOrganisation(), 'address' => array($this->contact->getAddress1(), $this->contact->getAddress2(), $this->contact->getAddress3()), 'suburb' => $this->contact->getSuburb(), 'state' => $this->contact->getState(), 'country' => $this->contact->getCountryCode(), 'postcode' => $this->contact->getPostcode(), 'phone' => $this->contact->getPhoneNumber(), 'fax' => $this->contact->getFaxNumber(), 'email' => $this->contact->getEmailAddress(), 'idProtect' => $this->idProtect->isTrue() ? 'Y' : '', 'doRenewal' => $this->doRenewal->isFalse() ? '0' : '');
 }