OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
Xpress_backup
/
vendor
/
aws
/
aws-sdk-php
/
tests
/
Glacier
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:19 AM
rwxr-xr-x
📄
GlacierClientTest.php
1.86 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
MultipartUploaderTest.php
3.92 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
TreeHashTest.php
2.75 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
test-content.txt
3 bytes
01/06/2025 08:22:57 AM
rw-r--r--
Editing: GlacierClientTest.php
Close
<?php namespace Aws\Test\Glacier; use Aws\Exception\CouldNotCreateChecksumException; use Aws\Glacier\GlacierClient; use Aws\Test\UsesServiceTrait; use GuzzleHttp\Psr7\NoSeekStream; use GuzzleHttp\Psr7; use Yoast\PHPUnitPolyfills\TestCases\TestCase; /** * @covers Aws\Glacier\GlacierClient */ class GlacierClientTest extends TestCase { use UsesServiceTrait; public function testAppliesAllMiddleware() { $client = new GlacierClient([ 'service' => 'glacier', 'region' => 'us-west-2', 'version' => 'latest' ]); $command = $client->getCommand('UploadArchive', [ 'vaultName' => 'foo', 'sourceFile' => __DIR__ . '/test-content.txt', ]); $request = \Aws\serialize($command); // Added default accountId and the API version header. $this->assertSame('-', $command['accountId']); $this->assertEquals( $client->getApi()->getMetadata('apiVersion'), $request->getHeaderLine('x-amz-glacier-version') ); // Added Content-Type and Body $this->assertSame('foo', (string)$command['body']); $this->assertSame('text/plain', $request->getHeaderLine('Content-Type')); // Added the tree and content hashes. $hash = hash('sha256', 'foo'); $this->assertSame($hash, $request->getHeaderLine('x-amz-content-sha256')); $this->assertSame($hash, $request->getHeaderLine('x-amz-sha256-tree-hash')); } public function testErrorWhenHashingNonSeekableStream() { $this->expectException(\Aws\Exception\CouldNotCreateChecksumException::class); $this->getTestClient('Glacier')->uploadArchive([ 'vaultName' => 'foo', 'body' => new NoSeekStream(Psr7\Utils::streamFor('foo')), ]); } }