Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96482882
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
Fri, Dec 27, 04:22
Size
792 B
Mime Type
text/x-php
Expires
Sun, Dec 29, 04:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23190646
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
);
}
}
protected
function
nextPage
(
array
$page
)
{
$this
->
offset
+=
count
(
$page
);
}
public
function
getQueryApplicationClass
()
{
return
null
;
}
}
Event Timeline
Log In to Comment