1
0
mirror of synced 2024-11-21 21:06:07 +03:00

settings method

This commit is contained in:
Pavel 2020-07-14 10:07:01 +03:00
parent 963eb19bfd
commit d9128fa5d1
3 changed files with 63 additions and 0 deletions

View File

@ -54,6 +54,7 @@ class ApiVersion5 extends AbstractLoader
use V5\Packs;
use V5\References;
use V5\Segments;
use V5\Settings;
use V5\Statistic;
use V5\Stores;
use V5\Tasks;

View File

@ -0,0 +1,44 @@
<?php
/**
* PHP version 5.4
*
* Settings
*
* @category RetailCrm
* @package RetailCrm
* @author RetailCrm <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
* @link https://help.retailcrm.ru/Developers/ApiVersion5
*/
namespace RetailCrm\Methods\V5;
/**
* PHP version 5.4
*
* Settings class
*
* @category RetailCrm
* @package RetailCrm
* @author RetailCrm <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
* @link https://help.retailcrm.ru/Developers/ApiVersion5
*/
trait Settings
{
/**
* Get settings
*
* @return \RetailCrm\Response\ApiResponse
*/
public function settings()
{
/* @noinspection PhpUndefinedMethodInspection */
return $this->client->makeRequest(
'/settings',
"GET",
[]
);
}
}

View File

@ -62,4 +62,22 @@ class CommonMethodsTest extends TestCase
static::assertTrue($response->isSuccessful());
static::assertGreaterThan(0, count($response['credentials']));
}
/**
* System settings
*
* @group api_methods
*
* @return void
*/
public function testSettings()
{
$client = static::getApiClient();
$response = $client->request->settings();
static::assertEquals(200, $response->getStatusCode());
static::assertTrue($response->isSuccessful());
static::assertGreaterThan(0, count($response['settings']));
}
}