Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4117847
MockClientEntity.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
MockClientEntity.php
View Options
<?php
namespace
MediaWiki\Extension\OAuth\Tests\Entity
;
use
MediaWiki\Extension\OAuth\Backend\Consumer
;
use
MediaWiki\Extension\OAuth\Entity\ClientEntity
;
use
MediaWiki\User\User
;
use
MWRestrictions
;
class
MockClientEntity
extends
ClientEntity
{
public
static
function
newMock
(
User
$user
,
$values
=
[]
)
{
$now
=
wfTimestampNow
();
return
ClientEntity
::
newFromArray
(
array_merge
(
[
'id'
=>
null
,
'consumerKey'
=>
'123456789'
,
'userId'
=>
$user
->
getId
(),
'name'
=>
'Test client'
,
'description'
=>
'Test application'
,
'wiki'
=>
'TestWiki'
,
'version'
=>
'1.0'
,
'email'
=>
$user
->
getEmail
(),
'emailAuthenticated'
=>
$now
,
'callbackUrl'
=>
'https://example.com'
,
'callbackIsPrefix'
=>
true
,
'developerAgreement'
=>
1
,
'secretKey'
=>
'secretKey'
,
'registration'
=>
$now
,
'stage'
=>
Consumer
::
STAGE_APPROVED
,
'stageTimestamp'
=>
$now
,
'grants'
=>
[
'editpage'
,
'highvolume'
],
'restrictions'
=>
MWRestrictions
::
newDefault
(),
'deleted'
=>
0
,
'rsaKey'
=>
''
,
'oauthVersion'
=>
Consumer
::
OAUTH_VERSION_2
,
'ownerOnly'
=>
false
,
'oauth2IsConfidential'
=>
true
,
'oauth2GrantTypes'
=>
[
'authorization_code'
,
'refresh_token'
]
],
$values
)
);
}
}
/** @deprecated class alias since 1.43 */
class_alias
(
MockClientEntity
::
class
,
'MediaWiki
\\
Extension
\\
OAuth
\\
Tests
\\
Entity
\\
Mock_ClientEntity'
);
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 02:23 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6f/be/d3ee4648ef7aa9e5e98b7ad1a37e
Default Alt Text
MockClientEntity.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment