@@ -128,8 +128,7 @@ public function testRegionInjectedWhenSet(): void {
128128 $ network = new Holodeck ();
129129 $ client = new Client ('username ' , 'password ' , null , 'ie1 ' , $ network );
130130 $ client ->request ('POST ' , 'https://test.twilio.com/v1/Resources ' );
131- // $this->expectException();
132- $ expected = new Request ('POST ' , 'https://test.dublin.ie1.twilio.com/v1/Resources ' );
131+ $ expected = new Request ('POST ' , 'https://test.ie1.twilio.com/v1/Resources ' );
133132 $ this ->assertTrue ($ network ->hasRequest ($ expected ));
134133 }
135134
@@ -283,40 +282,4 @@ public function testUserAgentExtensionsWhenSet(): void {
283282 $ this ->assertEquals ($ userAgentExtensions ,$ expectedExtensions );
284283 }
285284
286-
287- public function testEdgeIsSetFromRegionWhenEdgeIsNull (): void {
288- $ client = new Client ('username ' , 'password ' , null , 'au1 ' );
289- $ client ->request ('GET ' , 'https://api.twilio.com ' );
290- $ this ->assertEquals ('sydney ' , $ client ->getEdge ());
291- }
292-
293- public function testEdgeIsSetFromRegionWhenRegionIsXyz (): void {
294- // Create a mock of the CurlClient
295- $ mockHttpClient = $ this ->createMock (CurlClient::class);
296-
297- // Define the expected behavior
298- $ mockHttpClient ->expects ($ this ->once ())
299- ->method ('request ' )
300- ->with ('GET ' , 'https://api.xyz.twilio.com ' , [], [])
301- ->willReturn (new Response (200 , 'Mocked response ' ));
302- $ client = new Client ('username ' , 'password ' , null , 'xyz ' );
303- $ client ->setHttpClient ($ mockHttpClient );
304- $ client ->request ('GET ' , 'https://api.twilio.com ' );
305- $ this ->assertEquals ('' ,$ client ->getEdge ());
306- $ this ->assertEquals ('xyz ' , $ client ->getRegion ());
307- }
308-
309- public function testEdgeRemainsWhenBothEdgeAndRegionAreSet (): void {
310- $ client = new Client ('username ' , 'password ' , null , 'au1 ' );
311- $ client ->request ('GET ' , 'https://api.twilio.com ' );
312- $ client ->setEdge ('custom-edge ' );
313- $ this ->assertEquals ('custom-edge ' , $ client ->getEdge ());
314- }
315-
316- public function testEdgeRemainsWhenBothEdgeAndRegionAreSetInConstructor (): void {
317- $ client = new Client ('username ' , 'password ' , null , 'au1 ' , null , ['TWILIO_EDGE ' => 'custom-edge ' ]);
318- $ this ->assertEquals ('custom-edge ' , $ client ->getEdge ());
319- $ this ->assertEquals ('au1 ' , $ client ->getRegion ());
320-
321- }
322285}
0 commit comments