mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-18 05:43:15 +03:00
Fix assigning Ip
This commit is contained in:
parent
3354ac3514
commit
ff8c9c31b7
@ -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);
|
||||
|
37
tests/Api/IpTest.php
Normal file
37
tests/Api/IpTest.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013 Mailgun
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Mailgun\Tests\Api;
|
||||
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Mailgun\Api\Ip;
|
||||
use Mailgun\Model\Ip\UpdateResponse;
|
||||
|
||||
class IpTest extends TestCase
|
||||
{
|
||||
protected function getApiClass()
|
||||
{
|
||||
return Ip::class;
|
||||
}
|
||||
|
||||
public function testAssign()
|
||||
{
|
||||
$this->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');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user