ShipmentOriginTest.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Model\Shipment;
  6. use Magento\TestFramework\Helper\Bootstrap;
  7. use Magento\TestFramework\ObjectManager;
  8. use PHPUnit\Framework\TestCase;
  9. class ShipmentOriginTest extends TestCase
  10. {
  11. /** @var ObjectManager $objectManager */
  12. private $objectManager;
  13. /** @var Location $shipmentOrigin */
  14. private $shipmentOrigin;
  15. public function setUp()
  16. {
  17. parent::setUp();
  18. $this->objectManager = Bootstrap::getObjectManager();
  19. $this->shipmentOrigin = $this->objectManager->create(Location::class);
  20. $this->shipmentOrigin->setData(LocationInterface::CITY, 'CITY');
  21. $this->shipmentOrigin->setData(LocationInterface::COMPANY, 'COMPANY');
  22. $this->shipmentOrigin->setData(LocationInterface::COUNTRY_CODE, 'COUNTRY_CODE');
  23. $this->shipmentOrigin->setData(LocationInterface::EMAIL, 'EMAIL');
  24. $this->shipmentOrigin->setData(LocationInterface::PERSON_FIRST_NAME, 'PERSON_FIRST_NAME');
  25. $this->shipmentOrigin->setData(LocationInterface::PERSON_LAST_NAME, 'PERSON_LAST_NAME');
  26. $this->shipmentOrigin->setData(LocationInterface::PHONE_NUMBER, 'PHONE_NUMBER');
  27. $this->shipmentOrigin->setData(LocationInterface::POSTAL_CODE, 'POSTAL_CODE');
  28. $this->shipmentOrigin->setData(LocationInterface::REGION_CODE, 'REGION_CODE');
  29. $this->shipmentOrigin->setData(LocationInterface::STREET, 'STREET');
  30. }
  31. /**
  32. * @test
  33. */
  34. public function getCompanyTest()
  35. {
  36. $result = $this->shipmentOrigin->getCompany();
  37. $this->assertEquals($result, "COMPANY");
  38. }
  39. /**
  40. * @test
  41. */
  42. public function getPersonFirstNameTest()
  43. {
  44. $result = $this->shipmentOrigin->getPersonFirstName();
  45. $this->assertEquals($result, "PERSON_FIRST_NAME");
  46. }
  47. /**
  48. * @test
  49. */
  50. public function getPersonLastNameTest()
  51. {
  52. $result = $this->shipmentOrigin->getPersonLastName();
  53. $this->assertEquals($result, "PERSON_LAST_NAME");
  54. }
  55. /**
  56. * @test
  57. */
  58. public function getEmailTest()
  59. {
  60. $result = $this->shipmentOrigin->getEmail();
  61. $this->assertEquals($result, "EMAIL");
  62. }
  63. /**
  64. * @test
  65. */
  66. public function getPhoneNumberTest()
  67. {
  68. $result = $this->shipmentOrigin->getPhoneNumber();
  69. $this->assertEquals($result, "PHONE_NUMBER");
  70. }
  71. /**
  72. * @test
  73. */
  74. public function getStreetTest()
  75. {
  76. $result = $this->shipmentOrigin->getStreet();
  77. $this->assertEquals($result, "STREET");
  78. }
  79. /**
  80. * @test
  81. */
  82. public function getCityTest()
  83. {
  84. $result = $this->shipmentOrigin->getCity();
  85. $this->assertEquals($result, "CITY");
  86. }
  87. /**
  88. * @test
  89. */
  90. public function getPostalCodeTest()
  91. {
  92. $result = $this->shipmentOrigin->getPostalCode();
  93. $this->assertEquals($result, "POSTAL_CODE");
  94. }
  95. /**
  96. * @test
  97. */
  98. public function getRegionCodeTest()
  99. {
  100. $result = $this->shipmentOrigin->getRegionCode();
  101. $this->assertEquals($result, "REGION_CODE");
  102. }
  103. /**
  104. * @test
  105. */
  106. public function getCountryCodeTest()
  107. {
  108. $result = $this->shipmentOrigin->getCountryCode();
  109. $this->assertEquals($result, "COUNTRY_CODE");
  110. }
  111. }