2020-10-06 12:47:38 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* PHP version 7.3
|
|
|
|
*
|
|
|
|
* @category AuthorizationUriBuilderTest
|
|
|
|
* @package RetailCrm\Tests\Builder
|
|
|
|
* @author RetailCRM <integration@retailcrm.ru>
|
|
|
|
* @license http://retailcrm.ru Proprietary
|
|
|
|
* @link http://retailcrm.ru
|
|
|
|
* @see http://help.retailcrm.ru
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace RetailCrm\Tests\Builder;
|
|
|
|
|
|
|
|
use RetailCrm\Builder\AuthorizationUriBuilder;
|
|
|
|
use RetailCrm\Test\TestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class AuthorizationUriBuilderTest
|
|
|
|
*
|
|
|
|
* @category AuthorizationUriBuilderTest
|
|
|
|
* @package RetailCrm\Tests\Builder
|
|
|
|
* @author RetailDriver LLC <integration@retailcrm.ru>
|
|
|
|
* @license https://retailcrm.ru Proprietary
|
|
|
|
* @link http://retailcrm.ru
|
|
|
|
* @see https://help.retailcrm.ru
|
|
|
|
*/
|
|
|
|
class AuthorizationUriBuilderTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testBuild()
|
|
|
|
{
|
|
|
|
$appData = $this->getEnvAppData();
|
2020-10-06 17:39:02 +03:00
|
|
|
$builder = new AuthorizationUriBuilder($appData->getAppKey(), $appData->getRedirectUri(), true);
|
2020-10-06 12:47:38 +03:00
|
|
|
$result = $builder->build();
|
|
|
|
|
2020-10-06 17:39:02 +03:00
|
|
|
self::assertNotFalse(strpos($result->getAddress(), $appData->getAppKey()));
|
|
|
|
self::assertNotFalse(strpos($result->getAddress(), urlencode($appData->getRedirectUri())));
|
|
|
|
self::assertNotEmpty($result->getState());
|
2020-10-06 12:47:38 +03:00
|
|
|
}
|
|
|
|
}
|