Skip to content

Commit

Permalink
NextContinuationToken
Browse files Browse the repository at this point in the history
  • Loading branch information
fogelito committed Sep 18, 2023
1 parent abdb8f4 commit d4a6d46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Storage/Device/S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,11 @@ private function listObjects(string $prefix = '', int $maxKeys = 1000, string $c
'prefix' => $prefix,
'max-keys' => $maxKeys,
];
if (! empty($continuationToken)) {

if (!empty($continuationToken)) {
$parameters['continuation-token'] = $continuationToken;
}

$response = $this->call(self::METHOD_GET, $uri, '', $parameters);

return $response->body;
Expand Down
4 changes: 2 additions & 2 deletions tests/Storage/S3Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ public function testGetFilesPagination()
$this->assertEquals(3, $files['MaxKeys']);
$this->assertEquals(true, $files['IsTruncated']);
$this->assertIsArray($files['Contents']);
$this->assertNotEmpty($files['NextContinuationToken']);
$this->assertArrayHasKey('NextContinuationToken', $files);

$files = $this->object->getFiles($path, 1000, $files['NextContinuationToken']);
$this->assertEquals(1, $files['KeyCount']);
$this->assertEquals(1000, $files['MaxKeys']);
$this->assertEquals(false, $files['IsTruncated']);
$this->assertIsArray($files['Contents']);
$this->assertEmpty($files['NextContinuationToken']);
$this->assertArrayNotHasKey('NextContinuationToken', $files);
}

public function testName()
Expand Down

0 comments on commit d4a6d46

Please sign in to comment.