File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 19
19
<php >
20
20
<env name =" SHIPSTATION_TESTING" value =" false" />
21
21
<env name =" KEY" value =" " />
22
+ <env name =" PARTNER_KEY" value =" " />
22
23
<env name =" SECRET" value =" " />
23
24
<env name =" API_URL" value =" " />
24
25
</php >
Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ public function setUp()
22
22
exit ();
23
23
}
24
24
25
- $ this ->shipStation = new LaravelShipStation \ShipStation (getenv ('KEY ' ), getenv ('SECRET ' ), getenv ('API_URL ' ));
25
+ $ this ->shipStation = new LaravelShipStation \ShipStation (
26
+ getenv ('KEY ' ),
27
+ getenv ('SECRET ' ),
28
+ getenv ('API_URL ' ),
29
+ getenv ('PARTNER_KEY ' )
30
+ );
26
31
}
27
32
28
33
/** @test */
@@ -126,4 +131,19 @@ public function rate_limits_are_set_after_request()
126
131
$ this ->assertGreaterThanOrEqual (0 , $ this ->shipStation ->getSecondsUntilReset ());
127
132
$ this ->assertInternalType ('boolean ' , $ this ->shipStation ->isRateLimited ());
128
133
}
134
+
135
+ /** @test */
136
+ public function partner_api_key_header_is_set_when_defined ()
137
+ {
138
+ if (empty (getenv ('PARTNER_KEY ' ))) {
139
+ // nothing to test
140
+ return ;
141
+ }
142
+
143
+ $ this ->shipStation ->webhooks ->get ();
144
+
145
+ $ headers = $ this ->shipStation ->request ->getConfig ('headers ' );
146
+
147
+ $ this ->assertArrayHasKey ('x-partner ' , $ headers );
148
+ }
129
149
}
You can’t perform that action at this time.
0 commit comments