1
0
mirror of synced 2024-11-22 21:36:06 +03:00
api-client-php/tests/RetailCrm/Tests/Methods/CommonMethodsTest.php
2023-01-13 08:29:11 +01:00

96 lines
2.0 KiB
PHP
Executable File

<?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
{
/**
* Available versions
*
* @group api_methods
*
* @return void
*/
public function testAvailableVersions()
{
$client = static::getApiClient();
$response = $client->request->availableVersions();
static::assertEquals(200, $response->getStatusCode());
static::assertTrue($response->isSuccessful());
static::assertGreaterThan(0, count($response['versions']));
}
/**
* Available methods
*
* @group api_methods
*
* @return void
*/
public function testCredentials()
{
$client = static::getApiClient();
$response = $client->request->credentials();
static::assertEquals(200, $response->getStatusCode());
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']));
}
/**
* 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']);
}
}