1
0
mirror of synced 2024-11-29 16:56:07 +03:00
api-client-php/tests/RetailCrm/Tests/ApiClientUsersTest.php
Alex Lushpai fdd7c3d4c8 V5 (#37)
* update tests
* update version to 5.0.0, combine methods for orders & customer, update status method for users, custom fields|dictionaries & task methods, segments & product groups list methods, orders payments
2017-06-12 23:58:56 +03:00

69 lines
1.8 KiB
PHP

<?php
/**
* PHP version 5.3
*
* 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;
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
*/
public function testUsersList()
{
$client = static::getApiClient();
$response = $client->usersList();
static::assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
static::assertTrue(in_array($response->getStatusCode(), array(200, 201)));
static::assertTrue($response->isSuccessful());
}
/**
* @group users
*/
public function testUsersGet()
{
$client = static::getApiClient();
$response = $client->usersGet($_SERVER["CRM_USER_ID"]);
static::assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
static::assertTrue(in_array($response->getStatusCode(), array(200, 201)));
static::assertTrue($response->isSuccessful());
}
/**
* @group users
*/
public function testUsersStatus()
{
$client = static::getApiClient();
$response = $client->usersStatus($_SERVER["CRM_USER_ID"], 'dinner');
static::assertInstanceOf('RetailCrm\Response\ApiResponse', $response);
static::assertTrue(in_array($response->getStatusCode(), array(200, 201)));
static::assertTrue($response->isSuccessful());
}
}