File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace FedEx \Tests ;
4
+
5
+ use FedEx \RateService \Request ;
6
+ use FedEx \RateService \ComplexType \RateRequest ;
7
+ use FedEx \RateService \ComplexType \RateReply ;
8
+ use FedEx \Utility \ComplexTypePopulator ;
9
+
10
+ class AuthenticationTest extends TestCase
11
+ {
12
+ /**
13
+ * Test for handling an authentication error.
14
+ */
15
+ public function testAuthenticationFailed ()
16
+ {
17
+ $ rateRequest = new RateRequest ();
18
+
19
+ $ populator = new ComplexTypePopulator ();
20
+ $ populator ->populate ($ rateRequest );
21
+
22
+ $ expectedResponse = $ this ->mockResponseSerializer ->get ('error-authentication-failed.ser ' );
23
+
24
+ $ mockSoapClient = $ this ->getMockFromWsdl (Request::getWsdlPath ());
25
+ $ mockSoapClient ->method ('getRates ' )->will ($ this ->returnValue ($ expectedResponse ));
26
+
27
+ $ request = new Request ($ mockSoapClient );
28
+
29
+ $ ratesReply = $ request ->getGetRatesReply ($ rateRequest );
30
+
31
+ $ this ->assertInstanceOf (RateReply::class, $ ratesReply );
32
+ $ this ->assertEquals ('ERROR ' , $ ratesReply ->Notifications [0 ]->Severity );
33
+ $ this ->assertEquals (1000 , $ ratesReply ->Notifications [0 ]->Code );
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments