Skip to content

Commit 30c8cf3

Browse files
authored
Remove return docstrings for unit tests (#206)
- Remove `return` docstrings for unit tests - Remove EndShipper dependence on `testCreate`
1 parent 9217258 commit 30c8cf3

24 files changed

+208
-362
lines changed

test/EasyPost/AddressTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ class AddressTest extends \PHPUnit\Framework\TestCase
1111
{
1212
/**
1313
* Setup the testing environment for this file.
14-
*
15-
* @return void
1614
*/
1715
public static function setUpBeforeClass(): void
1816
{
@@ -23,8 +21,6 @@ public static function setUpBeforeClass(): void
2321

2422
/**
2523
* Cleanup the testing environment once finished.
26-
*
27-
* @return void
2824
*/
2925
public static function tearDownAfterClass(): void
3026
{
@@ -34,8 +30,6 @@ public static function tearDownAfterClass(): void
3430

3531
/**
3632
* Test creating an address.
37-
*
38-
* @return void
3933
*/
4034
public function testCreate()
4135
{
@@ -52,8 +46,6 @@ public function testCreate()
5246
* Test creating a verified address.
5347
*
5448
* We purposefully pass in slightly incorrect data to get the corrected address back once verified.
55-
*
56-
* @return void
5749
*/
5850
public function testCreateVerify()
5951
{
@@ -72,8 +64,6 @@ public function testCreateVerify()
7264

7365
/**
7466
* Test creating an address with verify_strict param.
75-
*
76-
* @return void
7767
*/
7868
public function testCreateVerifyStrict()
7969
{
@@ -93,8 +83,6 @@ public function testCreateVerifyStrict()
9383
* Test creating a verified address using the old array syntax for the `verify` key.
9484
*
9585
* We purposefully pass in slightly incorrect data to get the corrected address back once verified.
96-
*
97-
* @return void
9886
*/
9987
public function testCreateVerifyArray()
10088
{
@@ -113,8 +101,6 @@ public function testCreateVerifyArray()
113101

114102
/**
115103
* Test retrieving an address.
116-
*
117-
* @return void
118104
*/
119105
public function testRetrieve()
120106
{
@@ -130,8 +116,6 @@ public function testRetrieve()
130116

131117
/**
132118
* Test retrieving all addresses.
133-
*
134-
* @return void
135119
*/
136120
public function testAll()
137121
{
@@ -152,8 +136,6 @@ public function testAll()
152136
* Test creating a verified address.
153137
*
154138
* We purposefully pass in slightly incorrect data to get the corrected address back once verified.
155-
*
156-
* @return void
157139
*/
158140
public function testCreateAndVerify()
159141
{
@@ -170,8 +152,6 @@ public function testCreateAndVerify()
170152

171153
/**
172154
* Test we can verify an already created address.
173-
*
174-
* @return void
175155
*/
176156
public function testVerify()
177157
{

test/EasyPost/BatchTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class BatchTest extends \PHPUnit\Framework\TestCase
1212
{
1313
/**
1414
* Setup the testing environment for this file.
15-
*
16-
* @return void
1715
*/
1816
public static function setUpBeforeClass(): void
1917
{
@@ -24,8 +22,6 @@ public static function setUpBeforeClass(): void
2422

2523
/**
2624
* Cleanup the testing environment once finished.
27-
*
28-
* @return void
2925
*/
3026
public static function tearDownAfterClass(): void
3127
{
@@ -35,8 +31,6 @@ public static function tearDownAfterClass(): void
3531

3632
/**
3733
* Test creating a Batch.
38-
*
39-
* @return void
4034
*/
4135
public function testCreate()
4236
{
@@ -53,8 +47,6 @@ public function testCreate()
5347

5448
/**
5549
* Test retrieving a Batch.
56-
*
57-
* @return void
5850
*/
5951
public function testRetrieve()
6052
{
@@ -72,8 +64,6 @@ public function testRetrieve()
7264

7365
/**
7466
* Test retrieving all batches.
75-
*
76-
* @return void
7767
*/
7868
public function testAll()
7969
{
@@ -92,8 +82,6 @@ public function testAll()
9282

9383
/**
9484
* Test creating and buying a Batch in a single call.
95-
*
96-
* @return void
9785
*/
9886
public function testCreateAndBuy()
9987
{
@@ -111,8 +99,6 @@ public function testCreateAndBuy()
11199

112100
/**
113101
* Test buying a batch.
114-
*
115-
* @return void
116102
*/
117103
public function testBuy()
118104
{
@@ -135,8 +121,6 @@ public function testBuy()
135121

136122
/**
137123
* Test creating a scanform for a batch.
138-
*
139-
* @return void
140124
*/
141125
public function testCreateScanForm()
142126
{
@@ -162,8 +146,6 @@ public function testCreateScanForm()
162146

163147
/**
164148
* Test adding and removing a shipment from a batch.
165-
*
166-
* @return void
167149
*/
168150
public function testAddRemoveShipment()
169151
{
@@ -186,8 +168,6 @@ public function testAddRemoveShipment()
186168

187169
/**
188170
* Test generating a label for a Batch.
189-
*
190-
* @return void
191171
*/
192172
public function testLabel()
193173
{

test/EasyPost/Beta/EndShipperTest.php

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ class EndShipperTest extends \PHPUnit\Framework\TestCase
1010
{
1111
/**
1212
* Setup the testing environment for this file.
13-
*
14-
* @return void
1513
*/
1614
public static function setUpBeforeClass(): void
1715
{
@@ -22,8 +20,6 @@ public static function setUpBeforeClass(): void
2220

2321
/**
2422
* Cleanup the testing environment once finished.
25-
*
26-
* @return void
2723
*/
2824
public static function tearDownAfterClass(): void
2925
{
@@ -33,8 +29,6 @@ public static function tearDownAfterClass(): void
3329

3430
/**
3531
* Test creating an EndShipper.
36-
*
37-
* @return EndShipper
3832
*/
3933
public function testCreate()
4034
{
@@ -45,32 +39,25 @@ public function testCreate()
4539
$this->assertInstanceOf('\EasyPost\Beta\EndShipper', $endShipper);
4640
$this->assertStringMatchesFormat('es_%s', $endShipper->id);
4741
$this->assertEquals('388 TOWNSEND ST APT 20', $endShipper->street1);
48-
49-
return $endShipper;
5042
}
5143

5244
/**
5345
* Test retrieving an EndShipper.
54-
*
55-
* @depends testCreate
56-
* @return EndShipper
5746
*/
58-
public function testRetrieve(EndShipper $endShipper)
47+
public function testRetrieve()
5948
{
6049
VCR::insertCassette('end_shipper/retrieve.yml');
6150

51+
$endShipper = EndShipper::create(Fixture::end_shipper_address());
52+
6253
$retrievedEndShipper = EndShipper::retrieve($endShipper->id);
6354

6455
$this->assertInstanceOf('\EasyPost\Beta\EndShipper', $retrievedEndShipper);
6556
$this->assertEquals($endShipper->street1, $retrievedEndShipper->street1);
66-
67-
return $retrievedEndShipper;
6857
}
6958

7059
/**
7160
* Test retrieving all EndShippers.
72-
*
73-
* @return void
7461
*/
7562
public function testAll()
7663
{
@@ -86,14 +73,13 @@ public function testAll()
8673

8774
/**
8875
* Test updating an EndShipper.
89-
*
90-
* @depends testCreate
91-
* @return EndShipper
9276
*/
93-
public function testUpdate(EndShipper $endShipper)
77+
public function testUpdate()
9478
{
9579
VCR::insertCassette('end_shipper/update.yml');
9680

81+
$endShipper = EndShipper::create(Fixture::end_shipper_address());
82+
9783
// All caps because API will return all caps as part of verification.
9884
$newName = 'NEW NAME';
9985

test/EasyPost/BillingTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ class BillingTest extends \PHPUnit\Framework\TestCase
1010
{
1111
/**
1212
* Setup the testing environment for this file.
13-
*
14-
* @return void
1513
*/
1614
public static function setUpBeforeClass(): void
1715
{
@@ -22,8 +20,6 @@ public static function setUpBeforeClass(): void
2220

2321
/**
2422
* Cleanup the testing environment once finished.
25-
*
26-
* @return void
2723
*/
2824
public static function tearDownAfterClass(): void
2925
{
@@ -33,8 +29,6 @@ public static function tearDownAfterClass(): void
3329

3430
/**
3531
* Test funding a EasyPost wallet by using either primary or secondary payment method.
36-
*
37-
* @return void
3832
*/
3933
public function testFundWallet()
4034
{
@@ -49,8 +43,6 @@ public function testFundWallet()
4943

5044
/**
5145
* Test deleting a payment method.
52-
*
53-
* @return void
5446
*/
5547
public function testDeletePaymentMethod()
5648
{
@@ -65,8 +57,6 @@ public function testDeletePaymentMethod()
6557

6658
/**
6759
* Test retrieving all payment methods.
68-
*
69-
* @return void
7060
*/
7161
public function testRetrievePaymentMethods()
7262
{

test/EasyPost/CarrierAccountTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ class CarrierAccountTest extends \PHPUnit\Framework\TestCase
1111
{
1212
/**
1313
* Setup the testing environment for this file.
14-
*
15-
* @return void
1614
*/
1715
public static function setUpBeforeClass(): void
1816
{
@@ -23,8 +21,6 @@ public static function setUpBeforeClass(): void
2321

2422
/**
2523
* Cleanup the testing environment once finished.
26-
*
27-
* @return void
2824
*/
2925
public static function tearDownAfterClass(): void
3026
{
@@ -34,8 +30,6 @@ public static function tearDownAfterClass(): void
3430

3531
/**
3632
* Test creating a carrier account.
37-
*
38-
* @return void
3933
*/
4034
public function testCreate()
4135
{
@@ -52,8 +46,6 @@ public function testCreate()
5246

5347
/**
5448
* Test retrieving a carrier account.
55-
*
56-
* @return void
5749
*/
5850
public function testRetrieve()
5951
{
@@ -71,8 +63,6 @@ public function testRetrieve()
7163

7264
/**
7365
* Test retrieving all carrier accounts.
74-
*
75-
* @return void
7666
*/
7767
public function testAll()
7868
{
@@ -85,8 +75,6 @@ public function testAll()
8575

8676
/**
8777
* Test updating a carrier account.
88-
*
89-
* @return void
9078
*/
9179
public function testUpdate()
9280
{
@@ -108,8 +96,6 @@ public function testUpdate()
10896

10997
/**
11098
* Test deleting a carrier account.
111-
*
112-
* @return void
11399
*/
114100
public function testDelete()
115101
{
@@ -124,8 +110,6 @@ public function testDelete()
124110

125111
/**
126112
* Test retrieving the carrier account types available.
127-
*
128-
* @return void
129113
*/
130114
public function testTypes()
131115
{

0 commit comments

Comments
 (0)