1
0
mirror of synced 2024-11-25 13:16:01 +03:00
mg-bot-api-client-php/tests/Bot/Test/TestCase.php

55 lines
1.2 KiB
PHP
Raw Normal View History

2019-06-10 16:24:22 +03:00
<?php
/**
* PHP version 5.4
*
* Test case class
*
* @package Test
* @author RetailCrm <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
* @link http://www.retailcrm.ru/docs/Developers/ApiVersion5
*/
namespace RetailCrm\Mg\Bot\Test;
use PHPUnit\Framework\TestCase as BaseCase;
use RetailCrm\Mg\Bot\Client;
/**
* Class TestCase
*
* @category RetailCrm
* @package Test
* @author RetailCrm <integration@retailcrm.ru>
* @license https://opensource.org/licenses/MIT MIT License
* @link http://www.retailcrm.ru/docs/Developers/ApiVersion5
*/
class TestCase extends BaseCase
{
/**
* Return bot api client object
*
* @param string $url (default: null)
* @param string $key (default: null)
* @param bool $debug (default: false)
*
* @return \RetailCrm\Mg\Bot\Client
*/
public static function getApiClient(
$url = null,
$key = null,
$debug = false
) {
$configUrl = getenv('MG_BOT_URL');
$configKey = getenv('MG_BOT_KEY');
$configDbg = getenv('MG_BOT_DBG');
return new Client(
$url ?: $configUrl,
$key ?: $configKey,
$debug ?: $configDbg
);
}
}