OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
aws-ses
/
vendor
/
aws
/
aws-sdk-php
/
tests
/
S3
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📄
AmbiguousSuccessParserTest.php
3.68 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
ApplyChecksumMiddlewareTest.php
7.42 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
BatchDeleteTest.php
6.73 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
BucketEndpointArnMiddlewareTest.php
21.78 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
BucketEndpointMiddlewareTest.php
6.02 KB
05/19/2025 10:07:21 AM
rw-r--r--
📁
Crypto
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📁
Exception
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📄
GetBucketLocationParserTest.php
1.34 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
MultipartCopyTest.php
4.94 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
MultipartUploaderTest.php
12.52 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
ObjectCopierTest.php
15.15 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
ObjectUploaderTest.php
11.32 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
PermanentRedirectMiddlewareTest.php
982 bytes
05/19/2025 10:07:21 AM
rw-r--r--
📄
PostObjectTest.php
3.52 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
PostObjectV4Test.php
11.12 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
PutObjectUrlMiddlewareTest.php
2 KB
05/19/2025 10:07:21 AM
rw-r--r--
📁
RegionalEndpoint
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📄
RetryableMalformedResponseParserTest.php
934 bytes
05/19/2025 10:07:21 AM
rw-r--r--
📄
S3ClientTest.php
92.05 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
S3EndpointMiddlewareTest.php
30.05 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
S3MultiRegionClientTest.php
24.99 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
S3UriParserTest.php
7.45 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
SSECMiddlewareTest.php
2.91 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
StreamWrapperPathStyleTest.php
30.16 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
StreamWrapperTest.php
36.33 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
StreamWrapperV2ExistenceTest.php
32.63 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
TransferTest.php
14.24 KB
05/19/2025 10:07:21 AM
rw-r--r--
📁
UseArnRegion
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📄
ValidateResponseChecksumParserTest.php
5.45 KB
05/19/2025 10:07:21 AM
rw-r--r--
📁
fixtures
-
01/07/2025 12:10:31 PM
rwxr-xr-x
📄
sig_hack.php
226 bytes
05/19/2025 10:07:21 AM
rw-r--r--
📁
test_cases
-
01/07/2025 12:10:31 PM
rwxr-xr-x
Editing: AmbiguousSuccessParserTest.php
Close
<?php namespace Aws\Test\S3; use Aws\Api\ApiProvider; use Aws\Api\ErrorParser\XmlErrorParser; use Aws\Command; use Aws\CommandInterface; use Aws\S3\AmbiguousSuccessParser; use Aws\S3\Exception\S3Exception; use GuzzleHttp\Psr7\Response; use Psr\Http\Message\ResponseInterface; use Yoast\PHPUnitPolyfills\TestCases\TestCase; class AmbiguousSuccessParserTest extends TestCase { private $instance; public function set_up() { $parser = function () {}; $errorParser = function () { return ['code' => 'InternalError', 'message' => 'Sorry!']; }; $this->instance = new AmbiguousSuccessParser( $parser, $errorParser, S3Exception::class ); } /** * @dataProvider opsWithAmbiguousSuccessesProvider * * @param string $operation */ public function testConvertsAmbiguousSuccessesToExceptions($operation) { $this->expectExceptionMessage("Sorry!"); $this->expectException(\Aws\S3\Exception\S3Exception::class); $command = $this->getMockBuilder(CommandInterface::class)->getMock(); $command->expects($this->any()) ->method('getName') ->willReturn($operation); $response = $this->getMockBuilder(ResponseInterface::class)->getMock(); $response->expects($this->any()) ->method('getStatusCode') ->willReturn(200); $instance = $this->instance; $instance($command, $response); } /** * @dataProvider opsWithoutAmbiguousSuccessesProvider * @param string $operation * @doesNotPerformAssertions */ public function testIgnoresAmbiguousSuccessesOnUnaffectedOperations($operation) { $command = $this->getMockBuilder(CommandInterface::class)->getMock(); $command->expects($this->any()) ->method('getName') ->willReturn($operation); $response = $this->getMockBuilder(ResponseInterface::class)->getMock(); $response->expects($this->any()) ->method('getStatusCode') ->willReturn(200); $instance = $this->instance; $instance($command, $response); } /** * @dataProvider opsWithAmbiguousSuccessesProvider */ public function testThrowsConnectionErrorForEmptyBody($operation) { $this->expectExceptionMessage("An error connecting to the service occurred while performing the"); $this->expectException(\Aws\S3\Exception\S3Exception::class); $parser = function() {}; $errorParser = new XmlErrorParser(); $instance = new AmbiguousSuccessParser( $parser, $errorParser, S3Exception::class ); $command = new Command($operation); $response = new Response(200, [], "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n\n"); $instance($command, $response); } public function opsWithAmbiguousSuccessesProvider() { return [ ['CopyObject'], ['UploadPart'], ['UploadPartCopy'], ['CompleteMultipartUpload'], ]; } public function opsWithoutAmbiguousSuccessesProvider() { $provider = ApiProvider::defaultProvider(); return array_map( function ($op) { return [$op]; }, array_diff( array_keys($provider('api', 's3', 'latest')['operations']), array_map( function (array $args) { return $args[0]; }, $this->opsWithAmbiguousSuccessesProvider() ) ) ); } }