Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrice6713 committed Jul 19, 2024
1 parent ed1e765 commit 06798ea
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"defects":{"AccountTest::testAvailableNumbersError":4,"BadCredsTest::testAuthFail":4,"DisconnectsTest::testDisconnectCreate":3,"DisconnectsTest::testDisconnectsGet":3,"DisconnectsTest::testDisconnectGet":4,"NotesRefTest::testNotesDisconnects":4,"NotesTest::testNoteCreate":4,"NotesTest::testNotesGet":1,"NotesTest::testNotesGetTwoItems":1,"PortinsTest::testPortinsSetActivationStatus":3,"PortinsTest::testPortinsUpdate":3,"PortinsTest::testPortinsGet":3,"PortinsTest::testPortinGet":3,"PortinsTest::testPortinsHistory":3,"PortinsTest::testTotals":3,"PortinsTest::testLoasSend":4},"times":{"AccountTest::testLineOption":0.007,"AccountTest::testAvailableNumbersSingle":0.001,"AccountTest::testAvailableNumbers":0.001,"AccountTest::testAvailableNumbers2":0,"AccountTest::testAvailableNumbersError":0.003,"AccountTest::testAvailableNumbersNoResults":0,"AccountTest::testTnReservation":0,"AccountTest::testGetTnReservation":0,"AccountTest::testDeleteTnReservation":0,"AccountTest::testlnpChecker":0.003,"AccountTest::testNpaGet":0.001,"AccountTest::testInserviceGet":0,"AccountTest::testInserviceTotals":0,"AccountTest::testDiscNumbersGet":0,"AccountTest::testDisknumbersTotals":0,"AccountTest::testBdr":0.001,"AccountTest::testBillingReports":0.001,"AccountTest::testBillingReportRequest":0.001,"AccountTest::testBillingReportReadyAndDownload":0,"AccountTest::testGetImportTnOrder":0.002,"AccountTest::testRemoveImportedTnOrder":0.001,"AccountTest::testGetInserviceNumbers":0,"AccountTest::testCheckTnsPortability":0.001,"AccountTest::testCreateCsrOrder":0.001,"AccountTest::testGetCsrOrder":0.001,"AccountTest::testReplaceCsrOrder":0.001,"AccountTest::testGetCsrOrderNotes":0.001,"AccountTest::testGetImportTnOrderLoas":0,"AccountTest::testGetImportTnOrderLoaFileMetadata":0,"AccountTest::testGetAlternateEndUserInformation":0,"AccountTest::testGetAlternateCallerInformation":0,"AccountTest::testCreateEmergencyNotificationEndpointOrder":0,"AccountTest::testGetEmergencyNotificationEndpointOrders":0,"AccountTest::testGetEmergencyNotificationEndpointOrder":0,"AccountTest::testCreateEmergencyNotificationGroupOrder":0,"AccountTest::testGetEmergencyNotificationGroupOrders":0,"AccountTest::testGetEmergencyNotificationGroupOrder":0,"AccountTest::testGetEmergencyNotificationGroups":0,"AccountTest::testGetEmergencyNotificationGroup":0,"AccountTest::testCreateEmergencyNotificationRecipient":0,"AccountTest::testGetEmergencyNotificationRecipients":0,"AccountTest::testGetEmergencyNotificationRecipient":0,"AccountTest::testReplaceEmergencyNotificationRecipient":0,"AccountTest::testGetApplications":0,"AccountTest::testGetApplicationsOneResponse":0,"AccountTest::testGetApplication":0,"AccountTest::testCreateApplication":0,"AccountTest::testUpdateApplication":0,"AccountTest::testDeleteApplication":0,"AccountTest::testGetApplicationSippeers":0,"AccountTest::testGetApplicationSippeersOneResponse":0,"BadCredsTest::testAuthFail":0,"BaseModelTest::testContent":0,"BaseModelTest::testArray":0,"CoveredRateCenterTest::testTnsGet":0.002,"CoveredRateCenterTest::testTnGet":0.001,"DisconnectsTest::testDisconnectCreate":0.002,"DisconnectsTest::testDisconnectsGet":0.001,"DisconnectsTest::testDisconnectGet":0,"DldasTest::testLidbsPost":0.006,"DldasTest::testDldasGet":0.001,"DldasTest::testLidbGet":0.002,"DldasTest::testPut":0.003,"DldasTest::testLidbHistory":0.001,"LidbsTest::testLidbsGet":0.001,"LidbsTest::testLidbsPost":0.002,"LidbsTest::testLidbGet":0.002,"NotesRefTest::testNotesDisconnects":0,"NotesRefTest::testNotesOrders":0.001,"NotesRefTest::testNotesPortins":0.001,"NotesRefTest::testNotesPortouts":0.001,"NotesTest::testNoteCreate":0,"NotesTest::testNotesGet":0,"NotesTest::testNotesGetTwoItems":0,"OrderTest::testGetOrders":0.001,"OrderTest::testGetOrdersSingle":0.001,"OrderTest::testGetOrdersEmpty":0,"OrderTest::testOrderCreate":0.001,"OrderTest::testOrderGet":0.002,"OrderTest::testOrderPostArea":0.001,"OrderTest::testOrderRateCenter":0.001,"OrderTest::testOrderNpaNxx":0.001,"OrderTest::testOrderTollFree":0,"OrderTest::testOrderTollWildCard":0.001,"OrderTest::testOrderState":0.001,"OrderTest::testOrderCity":0.001,"OrderTest::testOrderZip":0.001,"OrderTest::testOrderLata":0.001,"OrderTest::testOrderPost":0,"OrderTest::testReservedPost":0.001,"OrderTest::testOrderTns":0.001,"OtherTest::testCitiesGet":0,"OtherTest::testRC":0,"PortinsTest::testPortinsCreate":0.003,"PortinsTest::testPortinsLoasDelete":0.001,"PortinsTest::testPortinsLoasGetMetadata":0,"PortinsTest::testPortinsLoasSetMetadata":0.001,"PortinsTest::testPortinsLoasDeleteMetadata":0,"PortinsTest::testPortinsGetLoas":0,"PortinsTest::testPortinsDelete":0,"PortinsTest::testPortinsGetActivationStatus":0,"PortinsTest::testPortinsSetActivationStatus":0.001,"PortinsTest::testPortinsUpdate":0.001,"PortinsTest::testPortinsGet":0.002,"PortinsTest::testPortinGet":0.002,"PortinsTest::testPortinsHistory":0.001,"PortinsTest::testTotals":0,"PortinsTest::testLoasSend":0.001,"ReportsTest::testReportsGet":0,"ReportsTest::testReportsGetIdAndInstances":0.003,"SippeersTest::testSippeerCreate":0.001,"SippeersTest::testSippeersGet":0.002,"SippeersTest::testSippeersGetOne":0.001,"SippeersTest::testSippeerGet":0.001,"SippeersTest::testSippeerUpdate":0,"SippeersTest::testSippeerDelete":0,"SippeersTest::testMoveTNs":0,"SippeersTest::testTNOptions":0.001,"SippeersTest::testGetTN":0,"SippeersTest::testGetTNs":0.001,"SippeersTest::testTotaltns":0,"SiteTest::testSiteCreate":0,"SiteTest::testSiteGet":0,"SiteTest::testSiteGetOne":0,"SiteTest::testSiteUpdate":0,"SiteTest::testSiteDelete":0,"SiteTest::testSiteOrders":0,"SiteTest::testSiteOrder":0,"SiteTest::testSiteOrderTns":0,"SiteTest::testSiteTotalTns":0,"SiteTest::testPortinsGet":0.003,"SubscriptionsTest::testSubsCreate":0.001,"SubscriptionsTest::testSubsGet":0,"SubscriptionsTest::testSubGet":0.001,"SubscriptionsTest::testSubPut":0.001,"SubscriptionsTest::testSubDelete":0,"TnsTest::testTnsGet":0.001,"TnsTest::testTnGet":0,"TnsTest::testSiteGet":0.001,"TnsTest::testSippeerGet":0.001,"TnsTest::testTNReservationGet":0.001,"TnsTest::testTnDetails":0.003,"TnsTest::testTnRatecenter":0,"TnsTest::testTnLata":0,"TnsTest::testTnLca":0.002,"UsersTest::testUsersGet":0.004,"UsersTest::testUserPassword":0}}
{"version":1,"defects":{"AccountTest::testAvailableNumbersError":4,"BadCredsTest::testAuthFail":4,"DisconnectsTest::testDisconnectCreate":3,"DisconnectsTest::testDisconnectsGet":3,"DisconnectsTest::testDisconnectGet":3,"NotesRefTest::testNotesDisconnects":4,"NotesTest::testNoteCreate":4,"NotesTest::testNotesGet":1,"NotesTest::testNotesGetTwoItems":1,"PortinsTest::testPortinsSetActivationStatus":3,"PortinsTest::testPortinsUpdate":3,"PortinsTest::testPortinsGet":3,"PortinsTest::testPortinGet":3,"PortinsTest::testPortinsHistory":3,"PortinsTest::testTotals":3,"PortinsTest::testLoasSend":4},"times":{"AccountTest::testLineOption":0.002,"AccountTest::testAvailableNumbersSingle":0.001,"AccountTest::testAvailableNumbers":0.001,"AccountTest::testAvailableNumbers2":0,"AccountTest::testAvailableNumbersError":0.001,"AccountTest::testAvailableNumbersNoResults":0,"AccountTest::testTnReservation":0,"AccountTest::testGetTnReservation":0,"AccountTest::testDeleteTnReservation":0,"AccountTest::testlnpChecker":0.002,"AccountTest::testNpaGet":0,"AccountTest::testInserviceGet":0,"AccountTest::testInserviceTotals":0,"AccountTest::testDiscNumbersGet":0,"AccountTest::testDisknumbersTotals":0,"AccountTest::testBdr":0,"AccountTest::testBillingReports":0.001,"AccountTest::testBillingReportRequest":0.001,"AccountTest::testBillingReportReadyAndDownload":0,"AccountTest::testGetImportTnOrder":0.001,"AccountTest::testRemoveImportedTnOrder":0,"AccountTest::testGetInserviceNumbers":0,"AccountTest::testCheckTnsPortability":0.001,"AccountTest::testCreateCsrOrder":0.001,"AccountTest::testGetCsrOrder":0.001,"AccountTest::testReplaceCsrOrder":0.001,"AccountTest::testGetCsrOrderNotes":0,"AccountTest::testGetImportTnOrderLoas":0,"AccountTest::testGetImportTnOrderLoaFileMetadata":0,"AccountTest::testGetAlternateEndUserInformation":0,"AccountTest::testGetAlternateCallerInformation":0,"AccountTest::testCreateEmergencyNotificationEndpointOrder":0,"AccountTest::testGetEmergencyNotificationEndpointOrders":0,"AccountTest::testGetEmergencyNotificationEndpointOrder":0,"AccountTest::testCreateEmergencyNotificationGroupOrder":0,"AccountTest::testGetEmergencyNotificationGroupOrders":0,"AccountTest::testGetEmergencyNotificationGroupOrder":0,"AccountTest::testGetEmergencyNotificationGroups":0,"AccountTest::testGetEmergencyNotificationGroup":0,"AccountTest::testCreateEmergencyNotificationRecipient":0,"AccountTest::testGetEmergencyNotificationRecipients":0,"AccountTest::testGetEmergencyNotificationRecipient":0,"AccountTest::testReplaceEmergencyNotificationRecipient":0,"AccountTest::testGetApplications":0,"AccountTest::testGetApplicationsOneResponse":0,"AccountTest::testGetApplication":0,"AccountTest::testCreateApplication":0,"AccountTest::testUpdateApplication":0,"AccountTest::testDeleteApplication":0,"AccountTest::testGetApplicationSippeers":0,"AccountTest::testGetApplicationSippeersOneResponse":0,"BadCredsTest::testAuthFail":0,"BaseModelTest::testContent":0,"BaseModelTest::testArray":0,"CoveredRateCenterTest::testTnsGet":0.002,"CoveredRateCenterTest::testTnGet":0.001,"DisconnectsTest::testDisconnectCreate":0.001,"DisconnectsTest::testDisconnectsGet":0.001,"DisconnectsTest::testDisconnectGet":0.001,"DldasTest::testLidbsPost":0.005,"DldasTest::testDldasGet":0.001,"DldasTest::testLidbGet":0.002,"DldasTest::testPut":0.002,"DldasTest::testLidbHistory":0.001,"LidbsTest::testLidbsGet":0.001,"LidbsTest::testLidbsPost":0.002,"LidbsTest::testLidbGet":0.002,"NotesRefTest::testNotesDisconnects":0.001,"NotesRefTest::testNotesOrders":0.001,"NotesRefTest::testNotesPortins":0.001,"NotesRefTest::testNotesPortouts":0,"NotesTest::testNoteCreate":0,"NotesTest::testNotesGet":0,"NotesTest::testNotesGetTwoItems":0,"OrderTest::testGetOrders":0.001,"OrderTest::testGetOrdersSingle":0.001,"OrderTest::testGetOrdersEmpty":0,"OrderTest::testOrderCreate":0.001,"OrderTest::testOrderGet":0.002,"OrderTest::testOrderPostArea":0.001,"OrderTest::testOrderRateCenter":0.001,"OrderTest::testOrderNpaNxx":0.001,"OrderTest::testOrderTollFree":0,"OrderTest::testOrderTollWildCard":0,"OrderTest::testOrderState":0.001,"OrderTest::testOrderCity":0.001,"OrderTest::testOrderZip":0.001,"OrderTest::testOrderLata":0.001,"OrderTest::testOrderPost":0.001,"OrderTest::testReservedPost":0.001,"OrderTest::testOrderTns":0,"OtherTest::testCitiesGet":0,"OtherTest::testRC":0,"PortinsTest::testPortinsCreate":0.003,"PortinsTest::testPortinsLoasDelete":0.001,"PortinsTest::testPortinsLoasGetMetadata":0,"PortinsTest::testPortinsLoasSetMetadata":0,"PortinsTest::testPortinsLoasDeleteMetadata":0,"PortinsTest::testPortinsGetLoas":0,"PortinsTest::testPortinsDelete":0,"PortinsTest::testPortinsGetActivationStatus":0,"PortinsTest::testPortinsSetActivationStatus":0,"PortinsTest::testPortinsUpdate":0,"PortinsTest::testPortinsGet":0.002,"PortinsTest::testPortinGet":0.002,"PortinsTest::testPortinsHistory":0.001,"PortinsTest::testTotals":0,"PortinsTest::testLoasSend":0,"ReportsTest::testReportsGet":0,"ReportsTest::testReportsGetIdAndInstances":0.003,"SippeersTest::testSippeerCreate":0.001,"SippeersTest::testSippeersGet":0.002,"SippeersTest::testSippeersGetOne":0.001,"SippeersTest::testSippeerGet":0.001,"SippeersTest::testSippeerUpdate":0,"SippeersTest::testSippeerDelete":0,"SippeersTest::testMoveTNs":0,"SippeersTest::testTNOptions":0,"SippeersTest::testGetTN":0.001,"SippeersTest::testGetTNs":0.001,"SippeersTest::testTotaltns":0,"SiteTest::testSiteCreate":0.001,"SiteTest::testSiteGet":0,"SiteTest::testSiteGetOne":0,"SiteTest::testSiteUpdate":0,"SiteTest::testSiteDelete":0,"SiteTest::testSiteOrders":0,"SiteTest::testSiteOrder":0,"SiteTest::testSiteOrderTns":0.001,"SiteTest::testSiteTotalTns":0,"SiteTest::testPortinsGet":0.002,"SubscriptionsTest::testSubsCreate":0.001,"SubscriptionsTest::testSubsGet":0,"SubscriptionsTest::testSubGet":0,"SubscriptionsTest::testSubPut":0,"SubscriptionsTest::testSubDelete":0,"TnsTest::testTnsGet":0.001,"TnsTest::testTnGet":0,"TnsTest::testSiteGet":0.001,"TnsTest::testSippeerGet":0.001,"TnsTest::testTNReservationGet":0.001,"TnsTest::testTnDetails":0.003,"TnsTest::testTnRatecenter":0,"TnsTest::testTnLata":0,"TnsTest::testTnLca":0.002,"UsersTest::testUsersGet":0.004,"UsersTest::testUserPassword":0}}
14 changes: 7 additions & 7 deletions src/DisconnectsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getList($filters = Array())
}

public function disconnect($id, $tndetail = false) {
$d = new Disconnect($this, array("orderId" => $id));
$d = new Disconnect($this, array("OrderId" => $id));
$d->get($tndetail);
return $d;
}
Expand Down Expand Up @@ -68,7 +68,7 @@ class Disconnect extends RestEntry {
"CountOfTNs" => [ "type" => "string" ],
"userId" => [ "type" => "string" ],
"lastModifiedDate" => [ "type" => "string" ],
"orderId" => [ "type" => "string" ],
"OrderId" => [ "type" => "string" ],
"OrderType" => [ "type" => "string" ],
"OrderDate" => [ "type" => "string" ],
"OrderStatus" => [ "type" => "string" ],
Expand Down Expand Up @@ -114,20 +114,20 @@ public function save() {
$data = parent::post(null, "DisconnectTelephoneNumberOrder", $this->to_array());
$this->OrderStatus = new OrderRequestStatus($data);
if(isset($this->OrderStatus->orderRequest)) {
$this->orderId = $this->OrderStatus->orderRequest->id;
$this->OrderId = $this->OrderStatus->orderRequest->id;
$this->set_data($this->OrderStatus->orderRequest->to_array());
}
}

/**
* Get Entity Id
* @return type
* @throws Exception in case of orderId is null
* @throws Exception in case of OrderId is null
*/
private function get_id() {
if(!isset($this->orderId))
throw new \Exception("You can't use this function without orderId");
return $this->orderId;
if(!isset($this->OrderId))
throw new \Exception("You can't use this function without OrderId");
return $this->OrderId;
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/AccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function testAvailableNumbers2() {
* @expectedExceptionCode 4000
*/
public function testAvailableNumbersError() {
$this->expectException(Iris\ResponseException::class);
$response = self::$account->availableNumbers();

$this->assertEquals("GET", self::$container[self::$index]['request']->getMethod());
Expand Down
3 changes: 2 additions & 1 deletion tests/BadCredsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function setUpBeforeClass(): void {
$handler = HandlerStack::create($mock);
$handler->push($history);

self::$client = new Iris\Client("test", "test", Array('url' => 'https://test.dashboard.bandwidth.com/', 'handler' => $handler));
self::$client = new Iris\Client("test", "test", Array('url' => 'https://api.test.inetwork.com/v1.0', 'handler' => $handler));
}

/**
Expand All @@ -30,6 +30,7 @@ public static function setUpBeforeClass(): void {
* @expectedExceptionCode 401
*/
public function testAuthFail() {
$this->expectException(Iris\ResponseException::class);
$c = new \Iris\Cities(self::$client);
try {
$cities = $c->getList(["state" => "NC"]);
Expand Down
Loading

0 comments on commit 06798ea

Please sign in to comment.