oauth2-client/test/src/Provider/AbstractProviderTest.php

42 lines
971 B
PHP
Raw Normal View History

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