@@ -12,7 +12,7 @@ class PortinsTest extends PHPUnit_Framework_TestCase {
12
12
13
13
public static function setUpBeforeClass () {
14
14
$ mock = new MockHandler ([
15
- new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><LnpOrderResponse><OrderId>d28b36f7-fa96-49eb-9556-a40fca49f7c6</OrderId><Status><Code>201</Code><Description>Order request received. Please use the order id to check the status of your order later.</Description></Status><ProcessingStatus>PENDING_DOCUMENTS</ProcessingStatus><LoaAuthorizingPerson>John Doe</LoaAuthorizingPerson><Subscriber><SubscriberType>BUSINESS</SubscriberType><BusinessName>Acme Corporation</BusinessName><ServiceAddress><HouseNumber>1623</HouseNumber><StreetName>Brockton Ave #1</StreetName><City>Los Angeles</City><StateCode>CA</StateCode><Zip>90025</Zip><Country>USA</Country></ServiceAddress></Subscriber><BillingTelephoneNumber>6882015002</BillingTelephoneNumber><ListOfPhoneNumbers><PhoneNumber>6882015025</PhoneNumber><PhoneNumber>6882015026</PhoneNumber></ListOfPhoneNumbers><Triggered>false</Triggered><BillingType>PORTIN</BillingType></LnpOrderResponse> " ),
15
+ new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><LnpOrderResponse><OrderId>d28b36f7-fa96-49eb-9556-a40fca49f7c6</OrderId><Status><Code>201</Code><Description>Order request received. Please use the order id to check the status of your order later.</Description></Status><ProcessingStatus>PENDING_DOCUMENTS</ProcessingStatus><LoaAuthorizingPerson>John Doe</LoaAuthorizingPerson><Subscriber><SubscriberType>BUSINESS</SubscriberType><BusinessName>Acme Corporation</BusinessName><ServiceAddress><HouseNumber>1623</HouseNumber><StreetName>Brockton Ave #1</StreetName><City>Los Angeles</City><StateCode>CA</StateCode><Zip>90025</Zip><Country>USA</Country></ServiceAddress></Subscriber><BillingTelephoneNumber>6882015002</BillingTelephoneNumber><NewBillingTelephoneNumber>9175131245</NewBillingTelephoneNumber><ListOfPhoneNumbers><PhoneNumber>6882015025</PhoneNumber><PhoneNumber>6882015026</PhoneNumber></ListOfPhoneNumbers><Triggered>false</Triggered><BillingType>PORTIN</BillingType></LnpOrderResponse> " ),
16
16
new Response (200 ),
17
17
new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><FileMetaData><DocumentName>test.txt</DocumentName><DocumentType>LOA</DocumentType></FileMetaData> " ),
18
18
new Response (200 ),
@@ -22,8 +22,8 @@ public static function setUpBeforeClass() {
22
22
new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><ActivationStatusResponse> <ActivationStatus> <AutoActivationDate>2014-08-29T18:30:00+03:00</AutoActivationDate> <ActivatedTelephoneNumbersList> <TelephoneNumber>6052609021</TelephoneNumber> <TelephoneNumber>6052609021</TelephoneNumber> </ActivatedTelephoneNumbersList> <NotYetActivatedTelephoneNumbersList/> </ActivationStatus></ActivationStatusResponse> " ),
23
23
new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><ActivationStatusResponse> <ActivationStatus> <AutoActivationDate>2014-08-29T18:30:00+03:00</AutoActivationDate> <ActivatedTelephoneNumbersList> <TelephoneNumber>6052609021</TelephoneNumber> <TelephoneNumber>6052609021</TelephoneNumber> </ActivatedTelephoneNumbersList> <NotYetActivatedTelephoneNumbersList/> </ActivationStatus></ActivationStatusResponse> " ),
24
24
new Response (200 , [], "<?xml version= \"1.0 \"?> <LnpOrderResponse><OrderId>0fe651a2-6ffc-4758-b7b7-e3eed66409ec</OrderId> <Status><Code>200</Code><Description>Supp request received. Please use the order id to check the status of your order later.</Description></Status><ProcessingStatus>REQUESTED_SUPP</ProcessingStatus><RequestedFocDate>2012-08-30T00:00:00Z</RequestedFocDate> </LnpOrderResponse> " ),
25
- new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><LNPResponseWrapper> <TotalCount>2</TotalCount> <Links> <first>Link=<https://api.test.inetwork.com:443/v1.0/accounts/9500249/portins?page=1&size=300>;rel= \"first \";</first> </Links> <lnpPortInfoForGivenStatus> <CountOfTNs>1</CountOfTNs> <userId>System</userId> <lastModifiedDate>2015-06-03T15:06:36.234Z</lastModifiedDate> <OrderDate>2015-06-03T15:06:35.533Z</OrderDate> <OrderId>535ba91e-5363-474e-8c97-c374a4aa6a02</OrderId> <OrderType>port_in</OrderType> <BillingTelephoneNumber>9193491234</BillingTelephoneNumber> <LNPLosingCarrierId>1537</LNPLosingCarrierId> <LNPLosingCarrierName>Test Losing Carrier L3</LNPLosingCarrierName> <ProcessingStatus>SUBMITTED</ProcessingStatus> <RequestedFOCDate>2015-06-03T15:30:00.000Z</RequestedFOCDate> <VendorId>49</VendorId> <VendorName>Bandwidth CLEC</VendorName> <PON>BWC1433343996123</PON> </lnpPortInfoForGivenStatus> <lnpPortInfoForGivenStatus> <CountOfTNs>1</CountOfTNs> <userId>byo_dev</userId> <lastModifiedDate>2015-06-03T15:10:13.384Z</lastModifiedDate> <OrderDate>2015-06-03T15:10:12.808Z</OrderDate> <OrderId>98939562-90b0-40e9-8335-5526432d9741</OrderId> <OrderType>port_in</OrderType> <BillingTelephoneNumber>7576768750</BillingTelephoneNumber> <LNPLosingCarrierId>1537</LNPLosingCarrierId> <LNPLosingCarrierName>Test Losing Carrier L3</LNPLosingCarrierName> <ProcessingStatus>SUBMITTED</ProcessingStatus> <RequestedFOCDate>2015-06-03T15:30:00.000Z</RequestedFOCDate> <VendorId>49</VendorId> <VendorName>Bandwidth CLEC</VendorName> <PON>BWC1433344213212</PON> </lnpPortInfoForGivenStatus></LNPResponseWrapper> " ),
26
- new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><LnpOrderResponse> <ProcessingStatus>SUBMITTED</ProcessingStatus> <RequestedFocDate>2015-06-03T15:30:00Z</RequestedFocDate> <LoaAuthorizingPerson>Joe Blow</LoaAuthorizingPerson> <Subscriber> <SubscriberType>BUSINESS</SubscriberType> <BusinessName>Company</BusinessName> <ServiceAddress> <HouseNumber>123</HouseNumber> <StreetName>EZ Street</StreetName> <City>Raleigh</City> <StateCode>NC</StateCode> <Zip>27615</Zip> <County>Wake</County> <Country>United States</Country> <AddressType>Service</AddressType> </ServiceAddress> </Subscriber> <BillingTelephoneNumber>9193491234</BillingTelephoneNumber> <ListOfPhoneNumbers> <PhoneNumber>9193491234</PhoneNumber> </ListOfPhoneNumbers> <PON>BWC1433343996123</PON> <AccountId>9500249</AccountId> <SiteId>2297</SiteId> <PeerId>500655</PeerId> <LosingCarrierName>Test Losing Carrier L3</LosingCarrierName> <VendorName>Bandwidth CLEC</VendorName> <OrderCreateDate>2015-06-03T15:06:35.533Z</OrderCreateDate> <LastModifiedDate>2015-06-03T15:06:36.234Z</LastModifiedDate> <userId>System</userId> <LastModifiedBy>System</LastModifiedBy> <PartialPort>false</PartialPort> <Immediately>false</Immediately> <Triggered>false</Triggered></LnpOrderResponse> " ),
25
+ new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><LNPResponseWrapper> <TotalCount>2</TotalCount> <Links> <first>Link=<https://api.test.inetwork.com:443/v1.0/accounts/9500249/portins?page=1&size=300>;rel= \"first \";</first> </Links> <lnpPortInfoForGivenStatus> <CountOfTNs>1</CountOfTNs> <userId>System</userId> <lastModifiedDate>2015-06-03T15:06:36.234Z</lastModifiedDate> <OrderDate>2015-06-03T15:06:35.533Z</OrderDate> <OrderId>535ba91e-5363-474e-8c97-c374a4aa6a02</OrderId> <OrderType>port_in</OrderType> <BillingTelephoneNumber>9193491234</BillingTelephoneNumber> <NewBillingTelephoneNumber>9175131245</NewBillingTelephoneNumber> <LNPLosingCarrierId>1537</LNPLosingCarrierId> <LNPLosingCarrierName>Test Losing Carrier L3</LNPLosingCarrierName> <ProcessingStatus>SUBMITTED</ProcessingStatus> <RequestedFOCDate>2015-06-03T15:30:00.000Z</RequestedFOCDate> <VendorId>49</VendorId> <VendorName>Bandwidth CLEC</VendorName> <PON>BWC1433343996123</PON> </lnpPortInfoForGivenStatus> <lnpPortInfoForGivenStatus> <CountOfTNs>1</CountOfTNs> <userId>byo_dev</userId> <lastModifiedDate>2015-06-03T15:10:13.384Z</lastModifiedDate> <OrderDate>2015-06-03T15:10:12.808Z</OrderDate> <OrderId>98939562-90b0-40e9-8335-5526432d9741</OrderId> <OrderType>port_in</OrderType> <BillingTelephoneNumber>7576768750</BillingTelephoneNumber> <NewBillingTelephoneNumber>9175131245</NewBillingTelephoneNumber> <LNPLosingCarrierId>1537</LNPLosingCarrierId> <LNPLosingCarrierName>Test Losing Carrier L3</LNPLosingCarrierName> <ProcessingStatus>SUBMITTED</ProcessingStatus> <RequestedFOCDate>2015-06-03T15:30:00.000Z</RequestedFOCDate> <VendorId>49</VendorId> <VendorName>Bandwidth CLEC</VendorName> <PON>BWC1433344213212</PON> </lnpPortInfoForGivenStatus></LNPResponseWrapper> " ),
26
+ new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><LnpOrderResponse> <ProcessingStatus>SUBMITTED</ProcessingStatus> <RequestedFocDate>2015-06-03T15:30:00Z</RequestedFocDate> <LoaAuthorizingPerson>Joe Blow</LoaAuthorizingPerson> <Subscriber> <SubscriberType>BUSINESS</SubscriberType> <BusinessName>Company</BusinessName> <ServiceAddress> <HouseNumber>123</HouseNumber> <StreetName>EZ Street</StreetName> <City>Raleigh</City> <StateCode>NC</StateCode> <Zip>27615</Zip> <County>Wake</County> <Country>United States</Country> <AddressType>Service</AddressType> </ServiceAddress> </Subscriber> <BillingTelephoneNumber>9193491234</BillingTelephoneNumber> <NewBillingTelephoneNumber>9175131245</NewBillingTelephoneNumber> <ListOfPhoneNumbers> <PhoneNumber>9193491234</PhoneNumber> </ListOfPhoneNumbers> <PON>BWC1433343996123</PON> <AccountId>9500249</AccountId> <SiteId>2297</SiteId> <PeerId>500655</PeerId> <LosingCarrierName>Test Losing Carrier L3</LosingCarrierName> <VendorName>Bandwidth CLEC</VendorName> <OrderCreateDate>2015-06-03T15:06:35.533Z</OrderCreateDate> <LastModifiedDate>2015-06-03T15:06:36.234Z</LastModifiedDate> <userId>System</userId> <LastModifiedBy>System</LastModifiedBy> <PartialPort>false</PartialPort> <Immediately>false</Immediately> <Triggered>false</Triggered></LnpOrderResponse> " ),
27
27
new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><OrderHistoryWrapper> <OrderHistory> <OrderDate>2015-06-03T15:06:35.765Z</OrderDate> <Note>LOA required</Note> <Author>byo_dev</Author> <Status>PENDING_DOCUMENTS</Status> </OrderHistory> <OrderHistory> <OrderDate>2015-06-03T15:06:36.234Z</OrderDate> <Note>Order has been created</Note> <Author>System</Author> <Status>SUBMITTED</Status> <Difference>LoaDate : \"\" --> Wed Jun 03 15:06:35 UTC 2015</Difference> </OrderHistory></OrderHistoryWrapper> " ),
28
28
new Response (200 , [], "<?xml version= \"1.0 \" encoding= \"UTF-8 \" standalone= \"yes \"?><Quantity><Count>4</Count></Quantity> " ),
29
29
]);
@@ -42,6 +42,7 @@ public function testPortinsCreate()
42
42
{
43
43
$ portin = self ::$ portins ->create (array (
44
44
"BillingTelephoneNumber " => "6882015002 " ,
45
+ "NewBillingTelephoneNumber " => "9175131245 " ,
45
46
"Subscriber " => array (
46
47
"SubscriberType " => "BUSINESS " ,
47
48
"BusinessName " => "Acme Corporation " ,
@@ -64,9 +65,11 @@ public function testPortinsCreate()
64
65
65
66
$ this ->assertEquals ("9882015026 " , $ portin ->ListOfPhoneNumbers ->PhoneNumber [1 ]);
66
67
$ this ->assertEquals ("Brockton Ave " , $ portin ->Subscriber ->ServiceAddress ->StreetName );
68
+ $ this ->assertEquals ("9175131245 " , $ portin ->NewBillingTelephoneNumber );
67
69
68
70
$ portin = self ::$ portins ->create (array (
69
71
"BillingTelephoneNumber " => "6882015002 " ,
72
+ "NewBillingTelephoneNumber " => "9175131245 " ,
70
73
"Subscriber " => array (
71
74
"SubscriberType " => "BUSINESS " ,
72
75
"BusinessName " => "Acme Corporation " ,
@@ -225,7 +228,7 @@ public function testPortinsGet() {
225
228
$ portins = self ::$ portins ->getList (["status " => "x " ]);
226
229
227
230
$ this ->assertEquals (2 , count ($ portins ));
228
- $ json = '{"CountOfTNs":"1","lastModifiedDate":"2015-06-03T15:06:36.234Z","OrderDate":"2015-06-03T15:06:35.533Z","OrderType":"port_in","LNPLosingCarrierId":"1537","LNPLosingCarrierName":"Test Losing Carrier L3","RequestedFOCDate":"2015-06-03T15:30:00.000Z","VendorId":"49","VendorName":"Bandwidth CLEC","PON":"BWC1433343996123","OrderId":"535ba91e-5363-474e-8c97-c374a4aa6a02","ProcessingStatus":"SUBMITTED","userId":"System","BillingTelephoneNumber":"9193491234"} ' ;
231
+ $ json = '{"CountOfTNs":"1","lastModifiedDate":"2015-06-03T15:06:36.234Z","OrderDate":"2015-06-03T15:06:35.533Z","OrderType":"port_in","LNPLosingCarrierId":"1537","LNPLosingCarrierName":"Test Losing Carrier L3","RequestedFOCDate":"2015-06-03T15:30:00.000Z","VendorId":"49","VendorName":"Bandwidth CLEC","PON":"BWC1433343996123","OrderId":"535ba91e-5363-474e-8c97-c374a4aa6a02","ProcessingStatus":"SUBMITTED","userId":"System","BillingTelephoneNumber":"9193491234","NewBillingTelephoneNumber":"9175131245" } ' ;
229
232
$ this ->assertEquals ($ json , json_encode ($ portins [0 ]->to_array ()));
230
233
$ this ->assertEquals ("GET " , self ::$ container [self ::$ index ]['request ' ]->getMethod ());
231
234
$ this ->assertEquals ("https://api.test.inetwork.com/v1.0/accounts/9500249/portins?status=x&page=1&size=30 " , self ::$ container [self ::$ index ]['request ' ]->getUri ());
@@ -236,7 +239,7 @@ public function testPortinGet()
236
239
{
237
240
$ portin = self ::$ portins ->portin ("d28b36f7-fa96-49eb-9556-a40fca49f7c6 " );
238
241
239
- $ json = '{"VendorName":"Bandwidth CLEC","PON":"BWC1433343996123","AccountId":"9500249","PeerId":"500655","OrderCreateDate":"2015-06-03T15:06:35.533Z","LastModifiedBy":"System","PartialPort":"false","Immediately":"false","OrderId":"d28b36f7-fa96-49eb-9556-a40fca49f7c6","ProcessingStatus":"SUBMITTED","RequestedFocDate":"2015-06-03T15:30:00Z","LosingCarrierName":"Test Losing Carrier L3","LastModifiedDate":"2015-06-03T15:06:36.234Z","userId":"System","BillingTelephoneNumber":"9193491234","Subscriber":{"SubscriberType":"BUSINESS","BusinessName":"Company","ServiceAddress":{"City":"Raleigh","HouseNumber":"123","StreetName":"EZ Street","StateCode":"NC","Zip":"27615","Country":"United States","County":"Wake","AddressType":"Service"}},"LoaAuthorizingPerson":"Joe Blow","ListOfPhoneNumbers":{"PhoneNumber":"9193491234"},"SiteId":"2297","Triggered":"false"} ' ;
242
+ $ json = '{"VendorName":"Bandwidth CLEC","PON":"BWC1433343996123","AccountId":"9500249","PeerId":"500655","OrderCreateDate":"2015-06-03T15:06:35.533Z","LastModifiedBy":"System","PartialPort":"false","Immediately":"false","OrderId":"d28b36f7-fa96-49eb-9556-a40fca49f7c6","ProcessingStatus":"SUBMITTED","RequestedFocDate":"2015-06-03T15:30:00Z","LosingCarrierName":"Test Losing Carrier L3","LastModifiedDate":"2015-06-03T15:06:36.234Z","userId":"System","BillingTelephoneNumber":"9193491234","NewBillingTelephoneNumber":"9175131245"," Subscriber":{"SubscriberType":"BUSINESS","BusinessName":"Company","ServiceAddress":{"City":"Raleigh","HouseNumber":"123","StreetName":"EZ Street","StateCode":"NC","Zip":"27615","Country":"United States","County":"Wake","AddressType":"Service"}},"LoaAuthorizingPerson":"Joe Blow","ListOfPhoneNumbers":{"PhoneNumber":"9193491234"},"SiteId":"2297","Triggered":"false"} ' ;
240
243
$ this ->assertEquals ($ json , json_encode ($ portin ->to_array ()));
241
244
242
245
$ this ->assertEquals ("GET " , self ::$ container [self ::$ index ]['request ' ]->getMethod ());
0 commit comments