2020-10-06 12:47:38 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* PHP version 7.3
|
|
|
|
*
|
|
|
|
* @category AuthorizationUriBuilderTest
|
|
|
|
* @package RetailCrm\Tests\Builder
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace RetailCrm\Tests\Builder;
|
|
|
|
|
|
|
|
use RetailCrm\Builder\AuthorizationUriBuilder;
|
|
|
|
use RetailCrm\Test\TestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class AuthorizationUriBuilderTest
|
|
|
|
*
|
|
|
|
* @category AuthorizationUriBuilderTest
|
|
|
|
* @package RetailCrm\Tests\Builder
|
|
|
|
*/
|
|
|
|
class AuthorizationUriBuilderTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testBuild()
|
|
|
|
{
|
|
|
|
$appData = $this->getEnvAppData();
|
2020-10-14 12:24:56 +03:00
|
|
|
$builder = new AuthorizationUriBuilder($appData->getAppKey(), $appData->getRedirectUri(), 'state');
|
2020-10-06 12:47:38 +03:00
|
|
|
$result = $builder->build();
|
|
|
|
|
2020-10-14 12:24:56 +03:00
|
|
|
self::assertNotFalse(strpos($result, $appData->getAppKey()));
|
|
|
|
self::assertNotFalse(strpos($result, urlencode($appData->getRedirectUri())));
|
|
|
|
self::assertNotFalse(strpos($result, urlencode('state')));
|
2020-10-06 12:47:38 +03:00
|
|
|
}
|
|
|
|
}
|