Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96789973
PhabricatorPolicyAwareTestQuery.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
Mon, Dec 30, 21:18
Size
720 B
Mime Type
text/x-php
Expires
Wed, Jan 1, 21:18 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23226455
Attached To
rPH Phabricator
PhabricatorPolicyAwareTestQuery.php
View Options
<?php
/**
* Configurable test query for implementing Policy unit tests.
*/
final
class
PhabricatorPolicyAwareTestQuery
extends
PhabricatorPolicyAwareQuery
{
private
$results
;
private
$offset
=
0
;
public
function
setResults
(
array
$results
)
{
$this
->
results
=
$results
;
return
$this
;
}
protected
function
willExecute
()
{
$this
->
offset
=
0
;
}
protected
function
loadPage
()
{
if
(
$this
->
getRawResultLimit
())
{
return
array_slice
(
$this
->
results
,
$this
->
offset
,
$this
->
getRawResultLimit
());
}
else
{
return
array_slice
(
$this
->
results
,
$this
->
offset
);
}
}
public
function
nextPage
(
array
$page
)
{
$this
->
offset
+=
count
(
$page
);
}
}
Event Timeline
Log In to Comment