for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* SocialConnect project
* @author: Patsura Dmitry https://github.com/ovr <[email protected]>
*/
namespace Test\Provider;
use SocialConnect\Common\Http\Client\ClientInterface;
use SocialConnect\Provider\Consumer;
use SocialConnect\Provider\Session\SessionInterface;
use Test\TestCase;
class AbstractProviderTest extends TestCase
{
* @param ClientInterface|null $httpClient
* @return ProviderMock
protected function getAbstractProviderMock(ClientInterface $httpClient = null, SessionInterface $session = null)
if (!$httpClient) {
$httpClient = $this->getMockBuilder(\SocialConnect\Common\Http\Client\Curl::class)
->disableOriginalConstructor()
->disableProxyingToOriginalMethods()
->getMock();
}
if (!$session) {
$session = $this->getMockBuilder(\SocialConnect\Provider\Session\Session::class)
return new ProviderMock(
$httpClient,
$session,
new Consumer(
'unknown',
'unkwown'
),
[
'redirectUri' => 'http://localhost:8000/${provider}/'
]
);
public function testGetRedirectUrl()
parent::assertSame('http://localhost:8000/fake/', $this->getAbstractProviderMock()->getRedirectUrl());