From ff8c9c31b7dc8daa6db8465f7749e4845a73304d Mon Sep 17 00:00:00 2001 From: Joseph Shanak Date: Mon, 5 Oct 2020 09:40:24 -0500 Subject: [PATCH] Fix assigning Ip --- src/Api/Ip.php | 2 +- tests/Api/IpTest.php | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 tests/Api/IpTest.php diff --git a/src/Api/Ip.php b/src/Api/Ip.php index dac8db8..80d4ab0 100644 --- a/src/Api/Ip.php +++ b/src/Api/Ip.php @@ -81,7 +81,7 @@ class Ip extends HttpApi Assert::ip($ip); $params = [ - 'id' => $ip, + 'ip' => $ip, ]; $response = $this->httpPost(sprintf('/v3/domains/%s/ips', $domain), $params); diff --git a/tests/Api/IpTest.php b/tests/Api/IpTest.php new file mode 100644 index 0000000..a319365 --- /dev/null +++ b/tests/Api/IpTest.php @@ -0,0 +1,37 @@ +setRequestMethod('POST'); + $this->setRequestUri('/v3/domains/example.com/ips'); + $this->setRequestBody([ + 'ip' => '127.0.0.1', + ]); + $this->setHydrateClass(UpdateResponse::class); + + $api = $this->getApiInstance(); + $api->assign('example.com', '127.0.0.1'); + } +}