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'); + } +}