2014-04-25 23:53:08 +04:00
|
|
|
<?php
|
|
|
|
|
2014-05-04 21:51:12 +04:00
|
|
|
namespace League\OAuth2\Client\Test\Provider;
|
2014-04-25 23:53:08 +04:00
|
|
|
|
|
|
|
use \Mockery as m;
|
|
|
|
|
2014-05-04 21:51:12 +04:00
|
|
|
class AbstractProviderTest extends \PHPUnit_Framework_TestCase
|
2014-04-25 23:53:08 +04:00
|
|
|
{
|
|
|
|
protected $provider;
|
|
|
|
|
|
|
|
protected function setUp()
|
|
|
|
{
|
|
|
|
$this->provider = new \League\OAuth2\Client\Provider\Google(array(
|
|
|
|
'clientId' => 'mock_client_id',
|
|
|
|
'clientSecret' => 'mock_secret',
|
|
|
|
'redirectUri' => 'none',
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @expectedException InvalidArgumentException
|
|
|
|
*/
|
|
|
|
public function testInvalidGrantString()
|
|
|
|
{
|
2014-05-04 21:51:12 +04:00
|
|
|
$this->provider->getAccessToken('invalid_grant', array('invalid_parameter' => 'none'));
|
2014-04-25 23:53:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @expectedException InvalidArgumentException
|
|
|
|
*/
|
|
|
|
public function testInvalidGrantObject()
|
|
|
|
{
|
|
|
|
$grant = new \StdClass;
|
2014-05-04 21:51:12 +04:00
|
|
|
$this->provider->getAccessToken($grant, array('invalid_parameter' => 'none'));
|
2014-04-25 23:53:08 +04:00
|
|
|
}
|
|
|
|
}
|