Skip to content

Commit 091cdd3

Browse files
authored
Merge pull request #53 from goshippo/api-version-v4
[API V4] Remove count from the library and fix test
2 parents 4c3cf8f + c615073 commit 091cdd3

11 files changed

+7
-23
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.2
1+
1.4.2

examples/basic-batch-shipment.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
Waiting for the batch to validate
1111
--> Batch object 6590eecf10f04c79a41bc6ffc6406b6f has status VALID
1212
--> batch now contains shipments: {
13-
"count": 2,
1413
"next": null,
1514
"previous": null,
1615
"results": [
@@ -37,7 +36,6 @@
3736
]
3837
}
3938
--> batch now contains shipments: {
40-
"count": 1,
4139
"next": null,
4240
"previous": null,
4341
"results": [

test/AddressTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public function testListAll()
6565
'results' => '3',
6666
'page' => '1'
6767
));
68-
$this->assertFalse(is_null($list->count));
6968
$this->assertFalse(is_null($list->results));
7069
}
7170

test/BatchTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ private function batchCreateResponse($carrier, $metadata) {
111111
'default_servicelevel_token' => 'usps_priority',
112112
'label_filetype' => 'PDF_4x6',
113113
'batch_shipments' => array(
114-
'count' => 0,
115114
'next' => null,
116115
'previous' => null,
117116
'results' => array()
@@ -138,7 +137,6 @@ private function batchRetrieveResponse($batch_id) {
138137
'default_servicelevel_token' => 'usps_priority',
139138
'label_filetype' => 'PDF_4x6',
140139
'batch_shipments' => array(
141-
'count' => 1,
142140
'next' => 'https://api.goshippo.com/batches/5ef63c54f5bf45d3b1f8fb37dcb1c5f4?object_results=creation_failed&page=3',
143141
'previous' => 'https://api.goshippo.com/batches/5ef63c54f5bf45d3b1f8fb37dcb1c5f4?object_results=creation_failed&page=1',
144142
'results' => array(
@@ -184,7 +182,6 @@ private function batchAddResponse($batch_id) {
184182
'default_servicelevel_token' => 'usps_priority',
185183
'label_filetype' => 'PDF_4x6',
186184
'batch_shipments' => array(
187-
'count' => 2,
188185
'next' => null,
189186
'previous' => null,
190187
'results' => array(
@@ -232,7 +229,6 @@ private function batchRemoveResponse($batch_id) {
232229
'default_servicelevel_token' => 'usps_priority',
233230
'label_filetype' => 'PDF_4x6',
234231
'batch_shipments' => array(
235-
'count' => 0,
236232
'next' => null,
237233
'previous' => null,
238234
'results' => array()
@@ -259,7 +255,6 @@ private function batchPurchaseResponse($batch_id) {
259255
'default_servicelevel_token' => 'usps_priority',
260256
'label_filetype' => 'PDF_4x6',
261257
'batch_shipments' => array(
262-
'count' => 1,
263258
'next' => null,
264259
'previous' => null,
265260
'results' => array(

test/CarrierAccountTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ class Shippo_CarrierAccountTest extends TestCase
55

66
public function testListAll() {
77
$list = Shippo_CarrierAccount::all();
8-
$this->assertFalse(is_null($list->count));
98
$this->assertFalse(is_null($list->results));
109
}
1110

test/CustomsDeclarationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public function testListAll()
4141
'results' => '3',
4242
'page' => '1'
4343
));
44-
$this->assertFalse(is_null($list->count));
4544
$this->assertFalse(is_null($list->results));
4645
}
4746

test/CustomsItemTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public function testListAll()
4141
'results' => '3',
4242
'page' => '1'
4343
));
44-
$this->assertFalse(is_null($list->count));
4544
$this->assertFalse(is_null($list->results));
4645
}
4746

test/ManifestTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public function testListAll()
3535
'results' => '3',
3636
'page' => '1'
3737
));
38-
$this->assertFalse(is_null($list->count));
3938
$this->assertFalse(is_null($list->results));
4039
}
4140

test/ParcelTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function testListAll()
4040
'results' => '3',
4141
'page' => '1'
4242
));
43-
$this->assertFalse(is_null($list->count));
4443
$this->assertFalse(is_null($list->results));
4544
}
4645

test/ShipmentTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
class Shippo_ShipmentTest extends TestCase
44
{
5-
5+
66
public function testValidCreate()
77
{
88
$shipment = self::getDefaultShipment();
99
$this->assertEquals($shipment->status, 'SUCCESS');
1010
}
11-
11+
1212
public function testInvalidCreate()
1313
{
1414
try {
@@ -20,24 +20,23 @@ public function testInvalidCreate()
2020
$this->assertTrue(true);
2121
}
2222
}
23-
23+
2424
public function testRetrieve()
2525
{
2626
$shipment = self::getDefaultShipment();
2727
$retrieve_shipment = Shippo_Shipment::retrieve($shipment->object_id);
2828
$this->assertEquals($retrieve_shipment->object_id, $shipment->object_id);
2929
}
30-
30+
3131
public function testListAll()
3232
{
3333
$list = Shippo_Shipment::all(array(
3434
'results' => '3',
3535
'page' => '1'
3636
));
37-
$this->assertFalse(is_null($list->count));
3837
$this->assertFalse(is_null($list->results));
3938
}
40-
39+
4140
public function testListPageSize()
4241
{
4342
$pagesize = 1;
@@ -47,7 +46,7 @@ public function testListPageSize()
4746
));
4847
$this->assertEquals(count($list->results), $pagesize);
4948
}
50-
49+
5150
public static function getDefaultShipment()
5251
{
5352
$addressFrom = Shippo_AddressTest::getDefaultAddress();
@@ -57,7 +56,6 @@ public static function getDefaultShipment()
5756
'address_from' => $addressFrom->object_id,
5857
'address_to' => $addressTo->object_id,
5958
'parcels' => array($parcel->object_id),
60-
'shipment_date' => '2013-12-03T12:00:00.000Z',
6159
'extra' => array(
6260
'signature_confirmation' => 'True',
6361
'insurance' => array(

0 commit comments

Comments
 (0)