1 | <?php |
||
3 | class UnleashedCustomerTest extends SapphireTest |
||
|
|||
4 | { |
||
5 | protected static $fixture_file = array( |
||
6 | 'silvershop/tests/fixtures/ShopMembers.yml', |
||
7 | 'silvershop/tests/fixtures/Orders.yml', |
||
8 | 'silvershop-unleashed/tests/fixtures/models.yml' |
||
9 | ); |
||
10 | |||
11 | public function setUp() |
||
18 | |||
19 | public function testGetAddressNameFromOrder() |
||
27 | |||
28 | public function testGetAddressNameItems() |
||
40 | |||
41 | public function testMatchCustomerAddress() |
||
64 | |||
65 | /** |
||
66 | * JSON data for test |
||
67 | * |
||
68 | * @link (Unleashed Software API Documentation, https://apidocs.unleashedsoftware.com/Products) |
||
69 | * @var string |
||
70 | */ |
||
71 | protected $jsondata = '[ |
||
72 | { |
||
73 | "Pagination": { |
||
74 | "NumberOfItems": 11, |
||
75 | "PageSize": 200, |
||
76 | "PageNumber": 1, |
||
77 | "NumberOfPages": 1 |
||
78 | }, |
||
79 | "Items": [ |
||
80 | { |
||
81 | "Addresses": [ |
||
82 | { |
||
83 | "AddressType": "Postal", |
||
84 | "AddressName": "1 Queen St", |
||
85 | "StreetAddress": "1 Queen St", |
||
86 | "StreetAddress2": "RD 2", |
||
87 | "Suburb": "", |
||
88 | "City": "Pukekohe", |
||
89 | "Region": "Auckland", |
||
90 | "Country": "New Zealand", |
||
91 | "PostalCode": "0622" |
||
92 | }, |
||
93 | { |
||
94 | "AddressType": "Physical", |
||
95 | "AddressName": "Main Warehouse", |
||
96 | "StreetAddress": "31 Hurstmere Road", |
||
97 | "StreetAddress2": "RD1", |
||
98 | "Suburb": "Takapuna", |
||
99 | "City": "Auckland", |
||
100 | "Region": "North Shore", |
||
101 | "Country": "New Zealand", |
||
102 | "PostalCode": "0622" |
||
103 | } |
||
104 | ], |
||
105 | "CustomerCode": "FRANCK", |
||
106 | "CustomerName": "Franck & Co.", |
||
107 | "GSTVATNumber": null, |
||
108 | "BankName": null, |
||
109 | "BankBranch": null, |
||
110 | "BankAccount": null, |
||
111 | "Website": null, |
||
112 | "PhoneNumber": null, |
||
113 | "FaxNumber": null, |
||
114 | "MobileNumber": null, |
||
115 | "DDINumber": null, |
||
116 | "TollFreeNumber": null, |
||
117 | "Email": null, |
||
118 | "EmailCC": null, |
||
119 | "Currency": { |
||
120 | "CurrencyCode": "USD", |
||
121 | "Description": "United States of America, Dollars", |
||
122 | "Guid": "3088672d-2a24-4d23-bb1c-c91813ed4c76", |
||
123 | "LastModifiedOn": "/Date(1458675959843)/" |
||
124 | }, |
||
125 | "Notes": null, |
||
126 | "Taxable": true, |
||
127 | "XeroContactId": null, |
||
128 | "SalesPerson": { |
||
129 | "FullName": "John Smith", |
||
130 | "Email": "[email protected]", |
||
131 | "Obsolete": false, |
||
132 | "Guid": "224ae802-88d3-43c1-b9cc-208d5d6d0ccf", |
||
133 | "LastModifiedOn": "/Date(1459218946890)/" |
||
134 | }, |
||
135 | "DiscountRate": 0, |
||
136 | "PrintPackingSlipInsteadOfInvoice": false, |
||
137 | "PrintInvoice": false, |
||
138 | "StopCredit": false, |
||
139 | "Obsolete": false, |
||
140 | "XeroSalesAccount": null, |
||
141 | "XeroCostOfGoodsAccount": null, |
||
142 | "SellPriceTier": "", |
||
143 | "SellPriceTierReference": null, |
||
144 | "CustomerType": "Cash", |
||
145 | "PaymentTerm": "20th Month following", |
||
146 | "ContactFirstName": null, |
||
147 | "ContactLastName": null, |
||
148 | "SourceId": null, |
||
149 | "CreatedBy": "admin", |
||
150 | "CreatedOn": "/Date(1411781315923)/", |
||
151 | "Guid": "d32d0ca7-fd8e-4a99-9da6-be546ac5252b", |
||
152 | "LastModifiedOn": "/Date(1459218740823)/" |
||
153 | } |
||
154 | ] |
||
155 | }]'; |
||
156 | } |
||
157 | |||
158 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.