update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2020 Alex Bilbie <hello@alexbilbie.com>
|
||||
Copyright (c) 2013-2023 Alex Bilbie <hello@alexbilbie.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -24,14 +24,15 @@ This package is compliant with [PSR-1][], [PSR-2][], [PSR-4][], and [PSR-7][]. I
|
||||
|
||||
We support the following versions of PHP:
|
||||
|
||||
* PHP 8.4
|
||||
* PHP 8.3
|
||||
* PHP 8.2
|
||||
* PHP 8.1
|
||||
* PHP 8.0
|
||||
* PHP 7.4
|
||||
* PHP 7.3
|
||||
* PHP 7.2
|
||||
* PHP 7.1
|
||||
* PHP 7.0
|
||||
* PHP 5.6
|
||||
|
||||
## Provider Clients
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
{
|
||||
"name": "league\/oauth2-client",
|
||||
"name": "league/oauth2-client",
|
||||
"description": "OAuth 2.0 Client Library",
|
||||
"license": "MIT",
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.6 || ^7.0 || ^8.0",
|
||||
"guzzlehttp\/guzzle": "^6.0 || ^7.0",
|
||||
"paragonie\/random_compat": "^1 || ^2 || ^9.99"
|
||||
"php": "^7.1 || >=8.0.0 <8.5.0",
|
||||
"ext-json": "*",
|
||||
"guzzlehttp/guzzle": "^6.5.8 || ^7.4.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery\/mockery": "^1.3.5",
|
||||
"php-parallel-lint\/php-parallel-lint": "^1.3.1",
|
||||
"phpunit\/phpunit": "^5.7 || ^6.0 || ^9.5",
|
||||
"squizlabs\/php_codesniffer": "^2.3 || ^3.0"
|
||||
"mockery/mockery": "^1.3.5",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.4",
|
||||
"phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11",
|
||||
"squizlabs/php_codesniffer": "^3.11"
|
||||
},
|
||||
"keywords": [
|
||||
"oauth",
|
||||
@@ -30,28 +30,24 @@
|
||||
{
|
||||
"name": "Alex Bilbie",
|
||||
"email": "hello@alexbilbie.com",
|
||||
"homepage": "http:\/\/www.alexbilbie.com",
|
||||
"homepage": "http://www.alexbilbie.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Woody Gilk",
|
||||
"homepage": "https:\/\/github.com\/shadowhand",
|
||||
"homepage": "https://github.com/shadowhand",
|
||||
"role": "Contributor"
|
||||
}
|
||||
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Pshowsso\\Scope68f5e85e9608b\\League\\OAuth2\\Client\\": "src\/"
|
||||
"League\\OAuth2\\Client\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Pshowsso\\Scope68f5e85e9608b\\League\\OAuth2\\Client\\Test\\": "test\/src\/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-2.x": "2.0.x-dev"
|
||||
"League\\OAuth2\\Client\\Test\\": "test/src/"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
36
modules/pshowsso/vendor/league/oauth2-client/phpunit.xml.dist
vendored
Normal file
36
modules/pshowsso/vendor/league/oauth2-client/phpunit.xml.dist
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
bootstrap="./vendor/autoload.php"
|
||||
colors="true"
|
||||
cacheDirectory="build/phpunit">
|
||||
|
||||
<coverage>
|
||||
<report>
|
||||
<clover outputFile="build/logs/clover.xml"/>
|
||||
<html outputDirectory="build/coverage"/>
|
||||
<text outputFile="php://stdout"/>
|
||||
</report>
|
||||
</coverage>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="all">
|
||||
<directory>test</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<logging>
|
||||
<junit outputFile="build/report.junit.xml"/>
|
||||
</logging>
|
||||
|
||||
<source>
|
||||
<include>
|
||||
<directory suffix=".php">src</directory>
|
||||
</include>
|
||||
</source>
|
||||
|
||||
<php>
|
||||
<env name="XDEBUG_MODE" value="coverage"/>
|
||||
</php>
|
||||
|
||||
</phpunit>
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "league\/oauth2-facebook",
|
||||
"name": "league/oauth2-facebook",
|
||||
"description": "Facebook OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sammy Kaye Powers",
|
||||
"email": "me@sammyk.me",
|
||||
"homepage": "http:\/\/www.sammyk.me"
|
||||
"homepage": "http://www.sammyk.me"
|
||||
}
|
||||
],
|
||||
"keywords": [
|
||||
@@ -19,22 +19,22 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.3",
|
||||
"league\/oauth2-client": "^2.0"
|
||||
"league/oauth2-client": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-json": "*",
|
||||
"phpunit\/phpunit": "^9.4",
|
||||
"mockery\/mockery": "~1.3.0",
|
||||
"squizlabs\/php_codesniffer": "~3.0"
|
||||
"phpunit/phpunit": "^9.4",
|
||||
"mockery/mockery": "~1.3.0",
|
||||
"squizlabs/php_codesniffer": "~3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Pshowsso\\Scope68f5e85e9608b\\League\\OAuth2\\Client\\": "src\/"
|
||||
"League\\OAuth2\\Client\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Pshowsso\\Scope68f5e85e9608b\\League\\OAuth2\\Client\\Test\\": "tests\/src\/"
|
||||
"League\\OAuth2\\Client\\Test\\": "tests/src/"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "league\/oauth2-github",
|
||||
"name": "league/oauth2-github",
|
||||
"description": "Github OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Steven Maguire",
|
||||
"email": "stevenmaguire@gmail.com",
|
||||
"homepage": "https:\/\/github.com\/stevenmaguire"
|
||||
"homepage": "https://github.com/stevenmaguire"
|
||||
}
|
||||
],
|
||||
"keywords": [
|
||||
@@ -18,21 +18,21 @@
|
||||
"github"
|
||||
],
|
||||
"require": {
|
||||
"league\/oauth2-client": "^2.0"
|
||||
"league/oauth2-client": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "~4.0",
|
||||
"mockery\/mockery": "~0.9",
|
||||
"squizlabs\/php_codesniffer": "~2.0"
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"mockery/mockery": "~0.9",
|
||||
"squizlabs/php_codesniffer": "~2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Pshowsso\\Scope68f5e85e9608b\\League\\OAuth2\\Client\\": "src\/"
|
||||
"League\\OAuth2\\Client\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Pshowsso\\Scope68f5e85e9608b\\League\\OAuth2\\Client\\Test\\": "test\/src\/"
|
||||
"League\\OAuth2\\Client\\Test\\": "test/src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
@@ -40,4 +40,4 @@
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Pshowsso\Scope68f5e85e9608b\League\OAuth2\Client\Test\Provider;
|
||||
<?php namespace League\OAuth2\Client\Test\Provider;
|
||||
|
||||
use Mockery as m;
|
||||
|
||||
class GithubResourceOwnerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testUrlIsNullWithoutDomainOrNickname()
|
||||
{
|
||||
$user = new \Pshowsso\Scope68f5e85e9608b\League\OAuth2\Client\Provider\GithubResourceOwner();
|
||||
$user = new \League\OAuth2\Client\Provider\GithubResourceOwner;
|
||||
|
||||
$url = $user->getUrl();
|
||||
|
||||
$this->assertNull($url);
|
||||
}
|
||||
|
||||
public function testUrlIsDomainWithoutNickname()
|
||||
{
|
||||
$domain = uniqid();
|
||||
$user = new \Pshowsso\Scope68f5e85e9608b\League\OAuth2\Client\Provider\GithubResourceOwner();
|
||||
$user = new \League\OAuth2\Client\Provider\GithubResourceOwner;
|
||||
$user->setDomain($domain);
|
||||
|
||||
$url = $user->getUrl();
|
||||
|
||||
$this->assertEquals($domain, $url);
|
||||
}
|
||||
|
||||
public function testUrlIsNicknameWithoutDomain()
|
||||
{
|
||||
$nickname = uniqid();
|
||||
$user = new \Pshowsso\Scope68f5e85e9608b\League\OAuth2\Client\Provider\GithubResourceOwner(['login' => $nickname]);
|
||||
$user = new \League\OAuth2\Client\Provider\GithubResourceOwner(['login' => $nickname]);
|
||||
|
||||
$url = $user->getUrl();
|
||||
|
||||
$this->assertEquals($nickname, $url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Pshowsso\Scope68f5e85e9608b\League\OAuth2\Client\Test\Provider;
|
||||
<?php namespace League\OAuth2\Client\Test\Provider;
|
||||
|
||||
use Mockery as m;
|
||||
|
||||
class GithubTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $provider;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->provider = new \Pshowsso\Scope68f5e85e9608b\League\OAuth2\Client\Provider\Github(['clientId' => 'mock_client_id', 'clientSecret' => 'mock_secret', 'redirectUri' => 'none']);
|
||||
$this->provider = new \League\OAuth2\Client\Provider\Github([
|
||||
'clientId' => 'mock_client_id',
|
||||
'clientSecret' => 'mock_secret',
|
||||
'redirectUri' => 'none',
|
||||
]);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
m::close();
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testAuthorizationUrl()
|
||||
{
|
||||
$url = $this->provider->getAuthorizationUrl();
|
||||
$uri = parse_url($url);
|
||||
parse_str($uri['query'], $query);
|
||||
|
||||
$this->assertArrayHasKey('client_id', $query);
|
||||
$this->assertArrayHasKey('redirect_uri', $query);
|
||||
$this->assertArrayHasKey('state', $query);
|
||||
@@ -28,75 +35,102 @@ class GithubTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertArrayHasKey('approval_prompt', $query);
|
||||
$this->assertNotNull($this->provider->getState());
|
||||
}
|
||||
|
||||
|
||||
public function testScopes()
|
||||
{
|
||||
$options = ['scope' => [uniqid(), uniqid()]];
|
||||
$options = ['scope' => [uniqid(),uniqid()]];
|
||||
|
||||
$url = $this->provider->getAuthorizationUrl($options);
|
||||
|
||||
$this->assertContains(urlencode(implode(',', $options['scope'])), $url);
|
||||
}
|
||||
|
||||
public function testGetAuthorizationUrl()
|
||||
{
|
||||
$url = $this->provider->getAuthorizationUrl();
|
||||
$uri = parse_url($url);
|
||||
|
||||
$this->assertEquals('/login/oauth/authorize', $uri['path']);
|
||||
}
|
||||
|
||||
public function testGetBaseAccessTokenUrl()
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$url = $this->provider->getBaseAccessTokenUrl($params);
|
||||
$uri = parse_url($url);
|
||||
|
||||
$this->assertEquals('/login/oauth/access_token', $uri['path']);
|
||||
}
|
||||
|
||||
public function testGetAccessToken()
|
||||
{
|
||||
$response = m::mock('Pshowsso\Scope68f5e85e9608b\Psr\Http\Message\ResponseInterface');
|
||||
$response = m::mock('Psr\Http\Message\ResponseInterface');
|
||||
$response->shouldReceive('getBody')->andReturn('{"access_token":"mock_access_token", "scope":"repo,gist", "token_type":"bearer"}');
|
||||
$response->shouldReceive('getHeader')->andReturn(['content-type' => 'json']);
|
||||
$response->shouldReceive('getStatusCode')->andReturn(200);
|
||||
$client = m::mock('Pshowsso\Scope68f5e85e9608b\GuzzleHttp\ClientInterface');
|
||||
|
||||
$client = m::mock('GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')->times(1)->andReturn($response);
|
||||
$this->provider->setHttpClient($client);
|
||||
|
||||
$token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']);
|
||||
|
||||
$this->assertEquals('mock_access_token', $token->getToken());
|
||||
$this->assertNull($token->getExpires());
|
||||
$this->assertNull($token->getRefreshToken());
|
||||
$this->assertNull($token->getResourceOwnerId());
|
||||
}
|
||||
|
||||
public function testGithubEnterpriseDomainUrls()
|
||||
{
|
||||
$this->provider->domain = 'https://github.company.com';
|
||||
$response = m::mock('Pshowsso\Scope68f5e85e9608b\Psr\Http\Message\ResponseInterface');
|
||||
|
||||
|
||||
$response = m::mock('Psr\Http\Message\ResponseInterface');
|
||||
$response->shouldReceive('getBody')->times(1)->andReturn('access_token=mock_access_token&expires=3600&refresh_token=mock_refresh_token&otherKey={1234}');
|
||||
$response->shouldReceive('getHeader')->andReturn(['content-type' => 'application/x-www-form-urlencoded']);
|
||||
$response->shouldReceive('getStatusCode')->andReturn(200);
|
||||
$client = m::mock('Pshowsso\Scope68f5e85e9608b\GuzzleHttp\ClientInterface');
|
||||
|
||||
$client = m::mock('GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')->times(1)->andReturn($response);
|
||||
$this->provider->setHttpClient($client);
|
||||
|
||||
$token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']);
|
||||
$this->assertEquals($this->provider->domain . '/login/oauth/authorize', $this->provider->getBaseAuthorizationUrl());
|
||||
$this->assertEquals($this->provider->domain . '/login/oauth/access_token', $this->provider->getBaseAccessTokenUrl([]));
|
||||
$this->assertEquals($this->provider->domain . '/api/v3/user', $this->provider->getResourceOwnerDetailsUrl($token));
|
||||
|
||||
$this->assertEquals($this->provider->domain.'/login/oauth/authorize', $this->provider->getBaseAuthorizationUrl());
|
||||
$this->assertEquals($this->provider->domain.'/login/oauth/access_token', $this->provider->getBaseAccessTokenUrl([]));
|
||||
$this->assertEquals($this->provider->domain.'/api/v3/user', $this->provider->getResourceOwnerDetailsUrl($token));
|
||||
//$this->assertEquals($this->provider->domain.'/api/v3/user/emails', $this->provider->urlUserEmails($token));
|
||||
}
|
||||
|
||||
public function testUserData()
|
||||
{
|
||||
$userId = rand(1000, 9999);
|
||||
$userId = rand(1000,9999);
|
||||
$name = uniqid();
|
||||
$nickname = uniqid();
|
||||
$email = uniqid();
|
||||
$postResponse = m::mock('Pshowsso\Scope68f5e85e9608b\Psr\Http\Message\ResponseInterface');
|
||||
|
||||
$postResponse = m::mock('Psr\Http\Message\ResponseInterface');
|
||||
$postResponse->shouldReceive('getBody')->andReturn('access_token=mock_access_token&expires=3600&refresh_token=mock_refresh_token&otherKey={1234}');
|
||||
$postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'application/x-www-form-urlencoded']);
|
||||
$postResponse->shouldReceive('getStatusCode')->andReturn(200);
|
||||
$userResponse = m::mock('Pshowsso\Scope68f5e85e9608b\Psr\Http\Message\ResponseInterface');
|
||||
$userResponse->shouldReceive('getBody')->andReturn('{"id": ' . $userId . ', "login": "' . $nickname . '", "name": "' . $name . '", "email": "' . $email . '"}');
|
||||
|
||||
$userResponse = m::mock('Psr\Http\Message\ResponseInterface');
|
||||
$userResponse->shouldReceive('getBody')->andReturn('{"id": '.$userId.', "login": "'.$nickname.'", "name": "'.$name.'", "email": "'.$email.'"}');
|
||||
$userResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']);
|
||||
$userResponse->shouldReceive('getStatusCode')->andReturn(200);
|
||||
$client = m::mock('Pshowsso\Scope68f5e85e9608b\GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')->times(2)->andReturn($postResponse, $userResponse);
|
||||
|
||||
$client = m::mock('GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')
|
||||
->times(2)
|
||||
->andReturn($postResponse, $userResponse);
|
||||
$this->provider->setHttpClient($client);
|
||||
|
||||
$token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']);
|
||||
$user = $this->provider->getResourceOwner($token);
|
||||
|
||||
$this->assertEquals($userId, $user->getId());
|
||||
$this->assertEquals($userId, $user->toArray()['id']);
|
||||
$this->assertEquals($name, $user->getName());
|
||||
@@ -107,6 +141,7 @@ class GithubTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($email, $user->toArray()['email']);
|
||||
$this->assertContains($nickname, $user->getUrl());
|
||||
}
|
||||
|
||||
public function testUserEmails()
|
||||
{
|
||||
/*
|
||||
@@ -114,24 +149,24 @@ class GithubTest extends \PHPUnit_Framework_TestCase
|
||||
$name = uniqid();
|
||||
$nickname = uniqid();
|
||||
$email = uniqid();
|
||||
|
||||
|
||||
$postResponse = m::mock('Psr\Http\Message\ResponseInterface');
|
||||
$postResponse->shouldReceive('getBody')->andReturn('access_token=mock_access_token&expires=3600&refresh_token=mock_refresh_token&otherKey={1234}');
|
||||
$postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'application/x-www-form-urlencoded']);
|
||||
|
||||
|
||||
$userResponse = m::mock('Psr\Http\Message\ResponseInterface');
|
||||
$userResponse->shouldReceive('getBody')->andReturn('[{"email":"mock_email_1","primary":false,"verified":true},{"email":"mock_email_2","primary":false,"verified":true},{"email":"mock_email_3","primary":true,"verified":true}]');
|
||||
$userResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']);
|
||||
|
||||
|
||||
$client = m::mock('GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')
|
||||
->times(2)
|
||||
->andReturn($postResponse, $userResponse);
|
||||
$this->provider->setHttpClient($client);
|
||||
|
||||
|
||||
$token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']);
|
||||
$emails = $this->provider->getUserEmails($token);
|
||||
|
||||
|
||||
$this->assertEquals($userId, $user->getUserId());
|
||||
$this->assertEquals($name, $user->getName());
|
||||
$this->assertEquals($nickname, $user->getNickname());
|
||||
@@ -139,33 +174,41 @@ class GithubTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertContains($nickname, $user->getUrl());
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException League\OAuth2\Client\Provider\Exception\IdentityProviderException
|
||||
**/
|
||||
public function testExceptionThrownWhenErrorObjectReceived()
|
||||
{
|
||||
$status = rand(400, 600);
|
||||
$postResponse = m::mock('Pshowsso\Scope68f5e85e9608b\Psr\Http\Message\ResponseInterface');
|
||||
$status = rand(400,600);
|
||||
$postResponse = m::mock('Psr\Http\Message\ResponseInterface');
|
||||
$postResponse->shouldReceive('getBody')->andReturn('{"message": "Validation Failed","errors": [{"resource": "Issue","field": "title","code": "missing_field"}]}');
|
||||
$postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']);
|
||||
$postResponse->shouldReceive('getStatusCode')->andReturn($status);
|
||||
$client = m::mock('Pshowsso\Scope68f5e85e9608b\GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')->times(1)->andReturn($postResponse);
|
||||
|
||||
$client = m::mock('GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')
|
||||
->times(1)
|
||||
->andReturn($postResponse);
|
||||
$this->provider->setHttpClient($client);
|
||||
$token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException League\OAuth2\Client\Provider\Exception\IdentityProviderException
|
||||
**/
|
||||
public function testExceptionThrownWhenOAuthErrorReceived()
|
||||
{
|
||||
$status = 200;
|
||||
$postResponse = m::mock('Pshowsso\Scope68f5e85e9608b\Psr\Http\Message\ResponseInterface');
|
||||
$postResponse = m::mock('Psr\Http\Message\ResponseInterface');
|
||||
$postResponse->shouldReceive('getBody')->andReturn('{"error": "bad_verification_code","error_description": "The code passed is incorrect or expired.","error_uri": "https://developer.github.com/v3/oauth/#bad-verification-code"}');
|
||||
$postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']);
|
||||
$postResponse->shouldReceive('getStatusCode')->andReturn($status);
|
||||
$client = m::mock('Pshowsso\Scope68f5e85e9608b\GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')->times(1)->andReturn($postResponse);
|
||||
|
||||
$client = m::mock('GuzzleHttp\ClientInterface');
|
||||
$client->shouldReceive('send')
|
||||
->times(1)
|
||||
->andReturn($postResponse);
|
||||
$this->provider->setHttpClient($client);
|
||||
$token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "league\/oauth2-google",
|
||||
"name": "league/oauth2-google",
|
||||
"description": "Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Woody Gilk",
|
||||
"email": "hello@shadowhand.com",
|
||||
"homepage": "https:\/\/shadowhand.com"
|
||||
"homepage": "https://shadowhand.com"
|
||||
}
|
||||
],
|
||||
"keywords": [
|
||||
@@ -20,24 +20,24 @@
|
||||
"minimum-stability": "stable",
|
||||
"require": {
|
||||
"php": "^7.3 || ^8.0",
|
||||
"league\/oauth2-client": "^2.0"
|
||||
"league/oauth2-client": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"eloquent\/phony-phpunit": "^6.0 || ^7.1",
|
||||
"phpunit\/phpunit": "^8.0 || ^9.0",
|
||||
"squizlabs\/php_codesniffer": "^3.0"
|
||||
"eloquent/phony-phpunit": "^6.0 || ^7.1",
|
||||
"phpunit/phpunit": "^8.0 || ^9.0",
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Pshowsso\\Scope68f5e85e9608b\\League\\OAuth2\\Client\\": "src\/"
|
||||
"League\\OAuth2\\Client\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Pshowsso\\Scope68f5e85e9608b\\League\\OAuth2\\Client\\Test\\": "test\/src\/"
|
||||
"League\\OAuth2\\Client\\Test\\": "test/src/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"check": "phpcs src test --standard=PSR12 -sp"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user