a18767bddc
* combine methods for orders & customer * update status method for users * custom fields|dictionaries * task methods * segments * product groups list methods, * orders payments * multi-version * customers notes methods
82 lines
2.3 KiB
PHP
82 lines
2.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* PHP version 5.4
|
|
*
|
|
* API client users test class
|
|
*
|
|
* @category RetailCrm
|
|
* @package RetailCrm
|
|
* @author RetailCrm <integration@retailcrm.ru>
|
|
* @license https://opensource.org/licenses/MIT MIT License
|
|
* @link http://www.retailcrm.ru/docs/Developers/ApiVersion5
|
|
*/
|
|
|
|
namespace RetailCrm\Tests\Methods\Version5;
|
|
|
|
use RetailCrm\Test\TestCase;
|
|
|
|
/**
|
|
* Class ApiClientUsersTest
|
|
*
|
|
* @category RetailCrm
|
|
* @package RetailCrm
|
|
* @author RetailCrm <integration@retailcrm.ru>
|
|
* @license https://opensource.org/licenses/MIT MIT License
|
|
* @link http://www.retailcrm.ru/docs/Developers/ApiVersion5
|
|
*/
|
|
class ApiClientUsersTest extends TestCase
|
|
{
|
|
/**
|
|
* @group users_v5
|
|
*/
|
|
public function testUsersGroups()
|
|
{
|
|
$client = static::getApiClient(null, null, "v5");
|
|
|
|
$response = $client->request->usersGroups();
|
|
static::assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
|
|
static::assertTrue(in_array($response->getStatusCode(), [200, 201]));
|
|
static::assertTrue($response->isSuccessful());
|
|
}
|
|
|
|
/**
|
|
* @group users_v5
|
|
*/
|
|
public function testUsersList()
|
|
{
|
|
$client = static::getApiClient(null, null, "v5");
|
|
|
|
$response = $client->request->usersList();
|
|
static::assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
|
|
static::assertTrue(in_array($response->getStatusCode(), [200, 201]));
|
|
static::assertTrue($response->isSuccessful());
|
|
}
|
|
|
|
/**
|
|
* @group users_v5
|
|
*/
|
|
public function testUsersGet()
|
|
{
|
|
$client = static::getApiClient(null, null, "v5");
|
|
|
|
$response = $client->request->usersGet($_SERVER["CRM_USER_ID"]);
|
|
static::assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
|
|
static::assertTrue(in_array($response->getStatusCode(), [200, 201]));
|
|
static::assertTrue($response->isSuccessful());
|
|
}
|
|
|
|
/**
|
|
* @group users_v5
|
|
*/
|
|
public function testUsersStatus()
|
|
{
|
|
$client = static::getApiClient(null, null, "v5");
|
|
|
|
$response = $client->request->usersStatus($_SERVER["CRM_USER_ID"], 'dinner');
|
|
static::assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
|
|
static::assertTrue(in_array($response->getStatusCode(), [200, 201]));
|
|
static::assertTrue($response->isSuccessful());
|
|
}
|
|
}
|