From 53cbd9d5782f5463a35302845775c7138b30291f Mon Sep 17 00:00:00 2001 From: Junade Ali Date: Mon, 4 Sep 2017 20:33:22 +0100 Subject: [PATCH] Finalised IPs endpoint --- README.md | 3 ++- src/Endpoints/IPs.php | 2 +- tests/Endpoints/IPsTest.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4334ed9..ac24a55 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,12 @@ Each API call is provided via a similarly named function within various classes - [x] DNS Records - [x] Zones - [x] User Administration (partial) -- [ ] Cloudflare IPs +- [x] Cloudflare IPs - [ ] Page Rules - [ ] Web Application Firewall (WAF) - [ ] Virtual DNS Management - [ ] Custom hostnames +- [ ] Zone Lockdown and User-Agent Block rules - [ ] Organization Administration - [ ] [Railgun](https://www.cloudflare.com/railgun/) administration - [ ] [Keyless SSL](https://blog.cloudflare.com/keyless-ssl-the-nitty-gritty-technical-details/) diff --git a/src/Endpoints/IPs.php b/src/Endpoints/IPs.php index 3bd8fd4..56f7f31 100644 --- a/src/Endpoints/IPs.php +++ b/src/Endpoints/IPs.php @@ -20,7 +20,7 @@ class IPs implements API $this->adapter = $adapter; } - public function get(): \stdClass { + public function listIPs(): \stdClass { $ips = $this->adapter->get('ips', []); $body = json_decode($ips->getBody()); diff --git a/tests/Endpoints/IPsTest.php b/tests/Endpoints/IPsTest.php index 35726f4..1a47bf8 100644 --- a/tests/Endpoints/IPsTest.php +++ b/tests/Endpoints/IPsTest.php @@ -10,7 +10,7 @@ use Cloudflare\API\Endpoints\IPs; class IPsTest extends PHPUnit_Framework_TestCase { - public function testGet() { + public function testListIPs() { $stream = GuzzleHttp\Psr7\stream_for(' { "success": true, @@ -35,7 +35,7 @@ class IPsTest extends PHPUnit_Framework_TestCase ); $ips = new \Cloudflare\API\Endpoints\IPs($mock); - $ips = $ips->get(); + $ips = $ips->listIPs(); $this->assertObjectHasAttribute("ipv4_cidrs", $ips); $this->assertObjectHasAttribute("ipv6_cidrs", $ips); }