From 2aae576f04e974d689db35c88207af63e5f6f3bc Mon Sep 17 00:00:00 2001 From: Woody Gilk Date: Sun, 22 Mar 2015 00:18:59 -0500 Subject: [PATCH] Use Fake provider for testing, instead of Google --- test/src/Grant/AuthorizationCodeTest.php | 2 +- test/src/Grant/ClientCredentialsTest.php | 2 +- test/src/Grant/PasswordTest.php | 2 +- test/src/Grant/RefreshTokenTest.php | 2 +- test/src/Provider/AbstractProviderTest.php | 2 +- test/src/Provider/Fake.php | 30 ++++++++++++++++++++++ 6 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 test/src/Provider/Fake.php diff --git a/test/src/Grant/AuthorizationCodeTest.php b/test/src/Grant/AuthorizationCodeTest.php index 969685b..5fd097c 100644 --- a/test/src/Grant/AuthorizationCodeTest.php +++ b/test/src/Grant/AuthorizationCodeTest.php @@ -11,7 +11,7 @@ class AuthorizationCodeTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->provider = new \League\OAuth2\Client\Provider\Google([ + $this->provider = new \League\OAuth2\Client\Test\Provider\Fake([ 'clientId' => 'mock_client_id', 'clientSecret' => 'mock_secret', 'redirectUri' => 'none', diff --git a/test/src/Grant/ClientCredentialsTest.php b/test/src/Grant/ClientCredentialsTest.php index 115fbd7..3d704f0 100644 --- a/test/src/Grant/ClientCredentialsTest.php +++ b/test/src/Grant/ClientCredentialsTest.php @@ -12,7 +12,7 @@ class ClientCredentialsTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->provider = new \League\OAuth2\Client\Provider\Google(array( + $this->provider = new \League\OAuth2\Client\Test\Provider\Fake(array( 'clientId' => 'mock_client_id', 'clientSecret' => 'mock_secret', 'redirectUri' => 'none', diff --git a/test/src/Grant/PasswordTest.php b/test/src/Grant/PasswordTest.php index bf6725a..7abff8d 100644 --- a/test/src/Grant/PasswordTest.php +++ b/test/src/Grant/PasswordTest.php @@ -12,7 +12,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->provider = new \League\OAuth2\Client\Provider\Google(array( + $this->provider = new \League\OAuth2\Client\Test\Provider\Fake(array( 'clientId' => 'mock_client_id', 'clientSecret' => 'mock_secret', 'redirectUri' => 'none', diff --git a/test/src/Grant/RefreshTokenTest.php b/test/src/Grant/RefreshTokenTest.php index 75b3bdb..7576b1c 100644 --- a/test/src/Grant/RefreshTokenTest.php +++ b/test/src/Grant/RefreshTokenTest.php @@ -11,7 +11,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->provider = new \League\OAuth2\Client\Provider\Google([ + $this->provider = new \League\OAuth2\Client\Test\Provider\Fake([ 'clientId' => 'mock_client_id', 'clientSecret' => 'mock_secret', 'redirectUri' => 'none', diff --git a/test/src/Provider/AbstractProviderTest.php b/test/src/Provider/AbstractProviderTest.php index b27e832..6092c3a 100644 --- a/test/src/Provider/AbstractProviderTest.php +++ b/test/src/Provider/AbstractProviderTest.php @@ -15,7 +15,7 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->provider = new \League\OAuth2\Client\Provider\Google([ + $this->provider = new \League\OAuth2\Client\Test\Provider\Fake([ 'clientId' => 'mock_client_id', 'clientSecret' => 'mock_secret', 'redirectUri' => 'none', diff --git a/test/src/Provider/Fake.php b/test/src/Provider/Fake.php new file mode 100644 index 0000000..0302de5 --- /dev/null +++ b/test/src/Provider/Fake.php @@ -0,0 +1,30 @@ +