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

Settings method

This commit is contained in:
Alex Lushpai 2020-07-14 11:24:01 +03:00 committed by GitHub
commit e3b452a0c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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']));
}
}