setCountry() public method

Sets the billing and shipping country.
public setCountry ( string $value ) : CreditCard
$value string
return CreditCard provides a fluent interface.
Exemplo n.º 1
0
 public function testCountry()
 {
     $this->card->setCountry('US');
     $this->assertEquals('US', $this->card->getCountry());
     $this->assertEquals('US', $this->card->getBillingCountry());
     $this->assertEquals('US', $this->card->getShippingCountry());
 }
 public function testCardDetails()
 {
     $card = new CreditCard();
     $card->setName('Test Foo');
     $card->setEmail('*****@*****.**');
     $card->setCompany('Test Company');
     $card->setPostcode('13100');
     $card->setCity('Nicetown');
     $card->setCountry('TN');
     $card->setPhone('00999555666');
     $card->setAddress1('Home street');
     $card->setAddress2('Near the shop');
     $this->request->setCard($card);
     $data = $this->request->getData();
     $this->assertSame("Test Foo", $data['CN']);
     $this->assertSame("*****@*****.**", $data['EMAIL']);
     $this->assertSame("Test Company", $data['COM']);
     $this->assertSame("13100", $data['OWNERZIP']);
     $this->assertSame("Nicetown", $data['OWNERTOWN']);
     $this->assertSame("TN", $data['OWNERCTY']);
     $this->assertSame("00999555666", $data['OWNERTELNO']);
     $this->assertSame("Home street", $data['OWNERADDRESS']);
     $this->assertSame("Near the shop", $data['OWNERADDRESS2']);
 }