Skip to content

Commit 7aa0db7

Browse files
committed
add interface fixture
1 parent 1df127e commit 7aa0db7

2 files changed

Lines changed: 103 additions & 0 deletions

File tree

dev/tests/Unit/Command/DocFxCommandTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ public function testDocFxFiles(string $file)
115115
$this->assertFileEqualsWithDiff($left, $right, '1' === getenv('UPDATE_FIXTURES'));
116116
}
117117

118+
public function testDocFxIterfaceFile()
119+
{
120+
self::getCommandTester()->execute([
121+
'--component' => 'Auth',
122+
'--xml' => self::$fixturesDir . '/phpdoc/auth.xml',
123+
'--out' => $tmpDir = sys_get_temp_dir() . '/' . rand(),
124+
'--metadata-version' => '1.0.0',
125+
'--path' => __DIR__ . '/../../../vendor/google/auth',
126+
'--with-cache' => true,
127+
]);
128+
129+
$left = self::$fixturesDir . '/docfx/Auth/FetchAuthTokenInterface.yml';
130+
$right = $tmpDir . '/FetchAuthTokenInterface.yml';
131+
$this->assertFileEqualsWithDiff($left, $right, '1' === getenv('UPDATE_FIXTURES'));
132+
}
133+
118134
/**
119135
* @depends testDocFxFiles
120136
*/
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
### YamlMime:UniversalReference
2+
items:
3+
-
4+
uid: \Google\Auth\FetchAuthTokenInterface
5+
name: FetchAuthTokenInterface
6+
friendlyApiName: 'Google Auth Library Client'
7+
id: FetchAuthTokenInterface
8+
summary: |-
9+
An interface implemented by objects that can fetch auth tokens.
10+
11+
Classes which implement this interface in this package:
12+
- <xref uid="\Google\Auth\Credentials\ExternalAccountCredentials">Credentials\ExternalAccountCredentials</xref>
13+
- <xref uid="\Google\Auth\Credentials\ServiceAccountJwtAccessCredentials">Credentials\ServiceAccountJwtAccessCredentials</xref>
14+
- <xref uid="\Google\Auth\Credentials\UserRefreshCredentials">Credentials\UserRefreshCredentials</xref>
15+
- <xref uid="\Google\Auth\Credentials\ServiceAccountCredentials">Credentials\ServiceAccountCredentials</xref>
16+
- <xref uid="\Google\Auth\Credentials\GCECredentials">Credentials\GCECredentials</xref>
17+
- <xref uid="\Google\Auth\Credentials\ImpersonatedServiceAccountCredentials">Credentials\ImpersonatedServiceAccountCredentials</xref>
18+
- <xref uid="\Google\Auth\Credentials\InsecureCredentials">Credentials\InsecureCredentials</xref>
19+
- <xref uid="\Google\Auth\CredentialsLoader">CredentialsLoader</xref>
20+
- <xref uid="\Google\Auth\FetchAuthTokenCache">FetchAuthTokenCache</xref>
21+
- <xref uid="\Google\Auth\OAuth2">OAuth2</xref>
22+
type: class
23+
namespace: 'Google \ Auth'
24+
langs:
25+
- php
26+
children:
27+
- '\Google\Auth\FetchAuthTokenInterface::fetchAuthToken()'
28+
- '\Google\Auth\FetchAuthTokenInterface::getCacheKey()'
29+
- '\Google\Auth\FetchAuthTokenInterface::getLastReceivedToken()'
30+
-
31+
uid: '\Google\Auth\FetchAuthTokenInterface::fetchAuthToken()'
32+
name: fetchAuthToken
33+
id: fetchAuthToken
34+
summary: 'Fetches the auth tokens based on the current state.'
35+
parent: \Google\Auth\FetchAuthTokenInterface
36+
type: method
37+
langs:
38+
- php
39+
syntax:
40+
parameters:
41+
-
42+
id: httpHandler
43+
var_type: callable|null
44+
description: 'callback which delivers psr7 request'
45+
returns:
46+
-
47+
var_type: array
48+
description: 'a hash of auth tokens'
49+
-
50+
uid: '\Google\Auth\FetchAuthTokenInterface::getCacheKey()'
51+
name: getCacheKey
52+
id: getCacheKey
53+
summary: |-
54+
Obtains a key that can used to cache the results of #fetchAuthToken.
55+
56+
If the value is empty, the auth token is not cached.
57+
parent: \Google\Auth\FetchAuthTokenInterface
58+
type: method
59+
langs:
60+
- php
61+
syntax:
62+
returns:
63+
-
64+
var_type: string
65+
description: 'a key that may be used to cache the auth token.'
66+
-
67+
uid: '\Google\Auth\FetchAuthTokenInterface::getLastReceivedToken()'
68+
name: getLastReceivedToken
69+
id: getLastReceivedToken
70+
summary: |-
71+
Returns an associative array with the token and
72+
expiration time.
73+
parent: \Google\Auth\FetchAuthTokenInterface
74+
type: method
75+
langs:
76+
- php
77+
syntax:
78+
returns:
79+
-
80+
var_type: null|array
81+
description: |-
82+
{
83+
The last received access token.
84+
85+
@type string $access_token The access token string.
86+
@type int $expires_at The time the token expires as a UNIX timestamp.
87+
}

0 commit comments

Comments
 (0)