Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F72683566
PhabricatorConpherenceRoomTestDataGenerator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jul 16, 13:33
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jul 18, 13:33 (2 d)
Engine
blob
Format
Raw Data
Handle
19089483
Attached To
rPH Phabricator
PhabricatorConpherenceRoomTestDataGenerator.php
View Options
<?php
final
class
PhabricatorConpherenceRoomTestDataGenerator
extends
PhabricatorTestDataGenerator
{
const
GENERATORKEY
=
'conpherence'
;
public
function
getGeneratorName
()
{
return
pht
(
'Conpherence'
);
}
public
function
generateObject
()
{
$author
=
$this
->
loadRandomUser
();
$name
=
$this
->
newRoomName
();
$participants
=
array
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$participants
[]
=
$this
->
loadRandomUser
();
$rando_phids
=
array
();
$rando_phids
[]
=
$author
->
getPHID
();
foreach
(
$participants
as
$actor
)
{
$rando_phids
[]
=
$actor
->
getPHID
();
}
$xactions
=
array
();
$xactions
[]
=
array
(
'type'
=>
'name'
,
'value'
=>
$name
,
);
$xactions
[]
=
array
(
'type'
=>
'participants.set'
,
'value'
=>
$rando_phids
,
);
$xactions
[]
=
array
(
'type'
=>
'view'
,
'value'
=>
'users'
,
);
$xactions
[]
=
array
(
'type'
=>
'edit'
,
'value'
=>
'users'
,
);
$params
=
array
(
'transactions'
=>
$xactions
,
);
$result
=
id
(
new
ConduitCall
(
'conpherence.edit'
,
$params
))
->
setUser
(
$author
)
->
execute
();
return
$result
[
'object'
][
'phid'
];
}
protected
function
newRoomName
()
{
$generator
=
new
PhabricatorConpherenceRoomContextFreeGrammar
();
$name
=
$generator
->
generate
();
return
$name
;
}
}
Event Timeline
Log In to Comment