Settings method
This commit is contained in:
commit
e3b452a0c2
@ -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;
|
||||
|
44
lib/RetailCrm/Methods/V5/Settings.php
Normal file
44
lib/RetailCrm/Methods/V5/Settings.php
Normal 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",
|
||||
[]
|
||||
);
|
||||
}
|
||||
}
|
@ -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']));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user