2017-09-27 16:59:56 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PHP version 5.4
|
|
|
|
*
|
|
|
|
* API client customers test class
|
|
|
|
*
|
|
|
|
* @category RetailCrm
|
|
|
|
* @package RetailCrm
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace RetailCrm\Tests\Methods;
|
|
|
|
|
|
|
|
use RetailCrm\Test\TestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class CommonMethodsTest
|
|
|
|
*
|
|
|
|
* @category RetailCrm
|
|
|
|
* @package RetailCrm
|
|
|
|
*/
|
|
|
|
class CommonMethodsTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
2018-01-10 11:35:57 +03:00
|
|
|
* Available versions
|
|
|
|
*
|
2017-09-27 16:59:56 +03:00
|
|
|
* @group api_methods
|
2018-01-10 11:35:57 +03:00
|
|
|
*
|
|
|
|
* @return void
|
2017-09-27 16:59:56 +03:00
|
|
|
*/
|
|
|
|
public function testAvailableVersions()
|
|
|
|
{
|
|
|
|
$client = static::getApiClient();
|
|
|
|
|
|
|
|
$response = $client->request->availableVersions();
|
|
|
|
|
|
|
|
static::assertEquals(200, $response->getStatusCode());
|
2018-01-10 11:35:57 +03:00
|
|
|
static::assertTrue($response->isSuccessful());
|
|
|
|
static::assertGreaterThan(0, count($response['versions']));
|
2017-09-27 16:59:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-01-10 11:35:57 +03:00
|
|
|
* Available methods
|
|
|
|
*
|
2017-09-27 16:59:56 +03:00
|
|
|
* @group api_methods
|
2018-01-10 11:35:57 +03:00
|
|
|
*
|
|
|
|
* @return void
|
2017-09-27 16:59:56 +03:00
|
|
|
*/
|
|
|
|
public function testCredentials()
|
|
|
|
{
|
|
|
|
$client = static::getApiClient();
|
|
|
|
|
|
|
|
$response = $client->request->credentials();
|
|
|
|
|
|
|
|
static::assertEquals(200, $response->getStatusCode());
|
2018-01-10 11:35:57 +03:00
|
|
|
static::assertTrue($response->isSuccessful());
|
|
|
|
static::assertGreaterThan(0, count($response['credentials']));
|
2017-09-27 16:59:56 +03:00
|
|
|
}
|
2020-07-14 10:07:01 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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']));
|
|
|
|
}
|
2023-01-13 10:29:11 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* System info
|
|
|
|
*
|
|
|
|
* @group api_methods
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testSystemInfo()
|
|
|
|
{
|
|
|
|
$client = static::getApiClient();
|
|
|
|
|
|
|
|
$response = $client->request->systemInfo();
|
|
|
|
|
|
|
|
static::assertEquals(200, $response->getStatusCode());
|
|
|
|
static::assertTrue($response->isSuccessful());
|
|
|
|
static::assertNotEmpty($response['systemVersion']);
|
|
|
|
}
|
2017-09-27 16:59:56 +03:00
|
|
|
}
|