diff --git a/src/Endpoints/RulesLists.php b/src/Endpoints/RulesLists.php index 68dbb2f..b019b95 100755 --- a/src/Endpoints/RulesLists.php +++ b/src/Endpoints/RulesLists.php @@ -76,7 +76,7 @@ class RulesLists implements API $response = $this->adapter->delete('accounts/' . $accountId . '/rules/lists/' . $listId); $this->body = json_decode($response->getBody()); - return $this->body; + return $this->body->result; } public function createListItem(string $accountId, string $listId, array $ip) diff --git a/tests/Endpoints/RulesListsTest.php b/tests/Endpoints/RulesListsTest.php index 54d86e5..bd6f74d 100755 --- a/tests/Endpoints/RulesListsTest.php +++ b/tests/Endpoints/RulesListsTest.php @@ -52,8 +52,8 @@ class RulesListsTest extends TestCase $rulesLists = new \Cloudflare\API\Endpoints\RulesLists($mock); $result = $rulesLists->deleteList('01a7362d577a6c3019a474fd6f485823', '2c0fc9fa937b11eaa1b71c4d701ab86e'); - $this->assertEquals(true, $result->success); - $this->assertEquals(true, $rulesLists->getBody()->success); + $this->assertEquals('2c0fc9fa937b11eaa1b71c4d701ab86e', $result->id); + $this->assertEquals('2c0fc9fa937b11eaa1b71c4d701ab86e', $rulesLists->getBody()->result->id); } public function testGetRulesLists() diff --git a/tests/Fixtures/Endpoints/deleteRulesList.json b/tests/Fixtures/Endpoints/deleteRulesList.json index 1683eb2..cf72665 100755 --- a/tests/Fixtures/Endpoints/deleteRulesList.json +++ b/tests/Fixtures/Endpoints/deleteRulesList.json @@ -12,7 +12,7 @@ } ], "result": { - "id": "34b12448945f11eaa1b71c4d701ab86e" + "id": "2c0fc9fa937b11eaa1b71c4d701ab86e" }, "success": true } \ No newline at end of file