Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function testGetSellToAddressWithBillingAddress()
- {
- $xml = new SimpleXMLElement('<Order><BillingData><Address><City>City1</City></Address></BillingData><FulfillmentData><Address><City>City2</City></Address></FulfillmentData></Order>');
- $result = $this->xmlReader->getSellToAddress($xml);
- $this->assertInstanceOf(SimpleXMLElement::class, $result);
- $this->assertSame('City1', (string)$result->City);
- }
- public function testGetSellToAddressWithFulfillmentAddress()
- {
- $xml = new SimpleXMLElement('<Order><BillingData><Address><City>City1</City></Address></BillingData><FulfillmentData><Address><City>City2</City></Address></FulfillmentData></Order>');
- $result = $this->xmlReader->getSellToAddress($xml);
- $this->assertInstanceOf(SimpleXMLElement::class, $result);
- $this->assertSame('City1', (string)$result->City);
- }
- public function testGetSellToAddressWithDifferentAddresses()
- {
- $xml = new SimpleXMLElement('<Order><BillingData><Address><City>City1</City></Address></BillingData><FulfillmentData><Address><City>City2</City></Address></FulfillmentData></Order>');
- $result = $this->xmlReader->getSellToAddress($xml);
- $this->assertInstanceOf(SimpleXMLElement::class, $result);
- $this->assertSame('City1', (string)$result->City);
- }
- public function testGetShipToAddressWithFulfillmentAddress()
- {
- $xml = new SimpleXMLElement('<Order><FulfillmentData><Address><City>City</City></Address></FulfillmentData></Order>');
- $result = $this->xmlReader->getShipToAddress($xml);
- $this->assertInstanceOf(SimpleXMLElement::class, $result);
- $this->assertSame('City', (string)$result->City);
- }
- public function testGetShipToAddressWithoutFulfillmentAddress()
- {
- $xml = new SimpleXMLElement('<Order></Order>');
- $result = $this->xmlReader->getShipToAddress($xml);
- $this->assertNull($result);
- }
- public function testGetStateOrRegionWithState()
- {
- $xml = new SimpleXMLElement('<Address><StateOrRegion>CA</StateOrRegion></Address>');
- $result = $this->xmlReader->getStateOrRegion($xml);
- $this->assertSame('CA', $result);
- }
- public function testGetStateOrRegionWithoutState()
- {
- $xml = new SimpleXMLElement('<Address></Address>');
- $result = $this->xmlReader->getStateOrRegion($xml);
- $this->assertSame('', $result);
- }
Advertisement
Add Comment
Please, Sign In to add comment