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

84 lines
1.9 KiB
PHP
Raw Normal View History

<?php
/**
* PHP version 5.4
*
* API client customers test class
*
* @category RetailCrm
* @package RetailCrm
* @author RetailCrm <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
2019-08-30 14:10:52 +03:00
* @link https://help.retailcrm.ru/Developers/ApiVersion5
*/
namespace RetailCrm\Tests\Methods;
use RetailCrm\Test\TestCase;
/**
* Class CommonMethodsTest
*
* @category RetailCrm
* @package RetailCrm
* @author RetailCrm <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
2019-08-30 14:10:52 +03:00
* @link https://help.retailcrm.ru/Developers/ApiVersion5
*/
class CommonMethodsTest extends TestCase
{
/**
2018-01-10 11:35:57 +03:00
* Available versions
*
* @group api_methods
2018-01-10 11:35:57 +03:00
*
* @return void
*/
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']));
}
/**
2018-01-10 11:35:57 +03:00
* Available methods
*
* @group api_methods
2018-01-10 11:35:57 +03:00
*
* @return void
*/
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']));
}
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']));
}
}