Skip to content

Commit

Permalink
using a second argument to fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
zedmonds96 committed Dec 30, 2024
1 parent cb26ba0 commit 0c083be
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public function testStreamedQueryJson() {
public function testStreamedLimit() {
$queryLimit = 75;
$pageLimit = 50;
$responseStreamMaxAge = 3600;
$data = json_encode([
"resources" => [
[
Expand All @@ -230,7 +231,7 @@ public function testStreamedLimit() {
"limit" => $queryLimit,
]);
// Set the row limit to 50 even though we're requesting 1000.
$container = $this->getQueryContainer($pageLimit);
$container = $this->getQueryContainer($pageLimit, $responseStreamMaxAge);
$downloadController = QueryDownloadController::create($container);
$request = $this->mockRequest($data);
ob_start([self::class, 'getBuffer']);
Expand Down Expand Up @@ -346,7 +347,7 @@ public function testStreamedBadSchema() {
* @return \MockChain\Chain
* MockChain chain object.
*/
private function getQueryContainer(int $rowLimit) {
private function getQueryContainer(int $rowLimit, ?int $responseStreamMaxAge = NULL) {
$options = (new Options())
->add("dkan.metastore.storage", DataFactory::class)
->add("dkan.datastore.service", DatastoreService::class)
Expand Down Expand Up @@ -413,7 +414,9 @@ private function getQueryContainer(int $rowLimit) {
->add(Query::class, "getQueryStorageMap", $storageMap)
->add(Query::class, 'getDatastoreService', DatastoreService::class)
->add(DatastoreService::class, 'getDataDictionaryFields', NULL)
->add(ImmutableConfig::class, 'get', $rowLimit);
// @todo Use an Options or Sequence return here; this will only work for one arg at a time.
->add(ImmutableConfig::class, 'get', $rowLimit)
->add(ImmutableConfig::class, 'get', $responseStreamMaxAge);

return $chain->getMock();
}
Expand Down

0 comments on commit 0c083be

Please sign in to comment.