Skip to content

Commit 121209e

Browse files
author
Junade Ali
committed
COM-45 :: Adjust Guzzle Tests
1 parent 1baeeee commit 121209e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/Adapter/GuzzleTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testPut()
5858
$this->assertEquals("application/json", $headers["Content-Type"][0]);
5959

6060
$body = json_decode($response->getBody());
61-
$this->assertEquals("Testing a PUT request.", $body->json->{"X-Put-Test"});
61+
$this->assertEquals("Testing a PUT request.", json_decode($body->json)->{"X-Put-Test"});
6262
}
6363

6464
public function testPatch()
@@ -70,7 +70,7 @@ public function testPatch()
7070
$this->assertEquals("application/json", $headers["Content-Type"][0]);
7171

7272
$body = json_decode($response->getBody());
73-
$this->assertEquals("Testing a PATCH request.", $body->json->{"X-Patch-Test"});
73+
$this->assertEquals("Testing a PATCH request.", json_decode($body->json)->{"X-Patch-Test"});
7474
}
7575

7676
public function testDelete()
@@ -82,7 +82,7 @@ public function testDelete()
8282
$this->assertEquals("application/json", $headers["Content-Type"][0]);
8383

8484
$body = json_decode($response->getBody());
85-
$this->assertEquals("Testing a DELETE request.", $body->form->{"X-Delete-Test"});
85+
$this->assertEquals("Testing a DELETE request.", $body->json->{"X-Delete-Test"});
8686
}
8787

8888
public function testErrors()

tests/Endpoints/ZonesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public function testGetZoneID()
290290
$this->assertEquals("023e105f4ecef8ad9ca31a8372d0c353", $result);
291291
}
292292

293-
public function testPurgeAll()
293+
public function testCachePurgeEverything()
294294
{
295295
$stream = GuzzleHttp\Psr7\stream_for('{
296296
"success": true,
@@ -312,7 +312,7 @@ public function testPurgeAll()
312312
);
313313

314314
$zones = new \Cloudflare\API\Endpoints\Zones($mock);
315-
$result = $zones->purgeAll("c2547eb745079dac9320b638f5e225cf483cc5cfdda41");
315+
$result = $zones->cachePurgeEverything("c2547eb745079dac9320b638f5e225cf483cc5cfdda41");
316316

317317
$this->assertTrue($result);
318318
}

0 commit comments

Comments
 (0)