Page MenuHomePhorge

PhabricatorPolicyAwareTestQuery.php
No OneTemporary

Size
792 B
Referenced Files
None
Subscribers
None

PhabricatorPolicyAwareTestQuery.php

<?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

Mime Type
text/x-php
Expires
Thu, May 29, 12:49 PM (21 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
197439
Default Alt Text
PhabricatorPolicyAwareTestQuery.php (792 B)

Event Timeline