Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2896381
PhabricatorPolicyAwareTestQuery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
792 B
Referenced Files
None
Subscribers
None
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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 23:00 (6 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1129655
Default Alt Text
PhabricatorPolicyAwareTestQuery.php (792 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment