OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
email
/
vendor
/
aws
/
aws-sdk-php
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/10/2024 05:23:06 AM
rwxr-xr-x
📄
AbstractConfigurationProviderTest.php
3.42 KB
07/10/2024 05:22:21 AM
rw-r--r--
📁
Api
-
07/10/2024 05:37:54 AM
rwxr-xr-x
📁
Arn
-
07/10/2024 05:27:54 AM
rwxr-xr-x
📁
Auth
-
07/10/2024 05:24:30 AM
rwxr-xr-x
📄
AwsClientTest.php
26.16 KB
07/10/2024 05:22:21 AM
rw-r--r--
📁
Build
-
07/10/2024 05:27:55 AM
rwxr-xr-x
📄
ClientResolverTest.php
55.74 KB
07/10/2024 05:22:21 AM
rw-r--r--
📁
ClientSideMonitoring
-
07/10/2024 05:24:31 AM
rwxr-xr-x
📁
CloudFront
-
07/10/2024 05:27:55 AM
rwxr-xr-x
📁
CloudSearchDomain
-
07/10/2024 05:24:33 AM
rwxr-xr-x
📁
CloudTrail
-
07/10/2024 05:24:33 AM
rwxr-xr-x
📁
CloudWatchLogs
-
07/10/2024 05:24:33 AM
rwxr-xr-x
📁
CognitoIdentity
-
07/10/2024 05:24:33 AM
rwxr-xr-x
📁
CognitoSync
-
07/10/2024 05:24:34 AM
rwxr-xr-x
📄
CommandPoolTest.php
5.8 KB
07/10/2024 05:22:21 AM
rw-r--r--
📄
CommandTest.php
3.28 KB
07/10/2024 05:22:21 AM
rw-r--r--
📄
ConfigurationResolverTest.php
12.35 KB
07/10/2024 05:22:21 AM
rw-r--r--
📁
Credentials
-
07/10/2024 05:37:43 AM
rwxr-xr-x
📁
Crypto
-
07/10/2024 05:27:55 AM
rwxr-xr-x
📁
DefaultsMode
-
07/10/2024 05:24:37 AM
rwxr-xr-x
📁
DocDb
-
07/10/2024 05:24:37 AM
rwxr-xr-x
📄
DoctrineCacheAdapterTest.php
1.23 KB
07/10/2024 05:22:21 AM
rw-r--r--
📁
DynamoDb
-
07/10/2024 05:24:38 AM
rwxr-xr-x
📁
Ec2
-
07/10/2024 05:24:38 AM
rwxr-xr-x
📁
ElasticLoadBalancingV2
-
07/10/2024 05:24:38 AM
rwxr-xr-x
📁
Endpoint
-
07/10/2024 05:27:56 AM
rwxr-xr-x
📁
EndpointDiscovery
-
07/10/2024 05:37:55 AM
rwxr-xr-x
📄
EndpointParameterMiddlewareTest.php
9.21 KB
07/10/2024 05:22:21 AM
rw-r--r--
📁
EndpointV2
-
07/10/2024 05:27:58 AM
rwxr-xr-x
📁
EventBridge
-
07/10/2024 05:24:41 AM
rwxr-xr-x
📁
Exception
-
07/10/2024 05:24:42 AM
rwxr-xr-x
📄
FunctionsTest.php
14.33 KB
07/10/2024 05:22:21 AM
rw-r--r--
📁
Glacier
-
07/10/2024 05:24:42 AM
rwxr-xr-x
📁
Handler
-
07/10/2024 05:28:00 AM
rwxr-xr-x
📄
HandlerListTest.php
7.16 KB
07/10/2024 05:22:22 AM
rw-r--r--
📄
HasMonitoringEventsTraitTest.php
895 bytes
07/10/2024 05:22:22 AM
rw-r--r--
📄
HashingStreamTest.php
1.41 KB
07/10/2024 05:22:22 AM
rw-r--r--
📄
HistoryTest.php
4.2 KB
07/10/2024 05:22:22 AM
rw-r--r--
📄
IdempotencyTokenMiddlewareTest.php
2.76 KB
07/10/2024 05:22:22 AM
rw-r--r--
📁
Identity
-
07/10/2024 05:28:00 AM
rwxr-xr-x
📄
InputValidationMiddlewareTest.php
5.62 KB
07/10/2024 05:22:22 AM
rw-r--r--
📁
Integ
-
07/10/2024 05:24:44 AM
rwxr-xr-x
📄
JsonCompilerTest.php
730 bytes
07/10/2024 05:22:22 AM
rw-r--r--
📁
Lambda
-
07/10/2024 05:24:44 AM
rwxr-xr-x
📁
LexModelsV2
-
07/10/2024 05:24:44 AM
rwxr-xr-x
📄
LruArrayCacheTest.php
1.59 KB
07/10/2024 05:22:22 AM
rw-r--r--
📁
MachineLearning
-
07/10/2024 05:24:44 AM
rwxr-xr-x
📄
MiddlewareTest.php
16.08 KB
07/10/2024 05:22:22 AM
rw-r--r--
📄
MockHandlerTest.php
3.79 KB
07/10/2024 05:22:22 AM
rw-r--r--
📄
MultiRegionClientTest.php
5.41 KB
07/10/2024 05:22:23 AM
rw-r--r--
📁
Multipart
-
07/10/2024 05:24:45 AM
rwxr-xr-x
📁
Neptune
-
07/10/2024 05:24:45 AM
rwxr-xr-x
📄
PerformanceContext.php
8.2 KB
07/10/2024 05:22:23 AM
rw-r--r--
📄
PhpHashTest.php
1.33 KB
07/10/2024 05:22:23 AM
rw-r--r--
📁
Polly
-
07/10/2024 05:24:45 AM
rwxr-xr-x
📄
PresignUrlMiddlewareTest.php
3.95 KB
07/10/2024 05:22:23 AM
rw-r--r--
📄
Psr16CacheAdapterTest.php
1.84 KB
07/10/2024 05:22:23 AM
rw-r--r--
📄
PsrCacheAdapterTest.php
2.64 KB
07/10/2024 05:22:23 AM
rw-r--r--
📄
QueryCompatibleInputMiddlewareTest.php
9.1 KB
07/10/2024 05:22:23 AM
rw-r--r--
📁
Rds
-
07/10/2024 05:24:46 AM
rwxr-xr-x
📁
RequestCompression
-
07/10/2024 05:28:00 AM
rwxr-xr-x
📄
ResultPaginatorTest.php
16.21 KB
07/10/2024 05:22:23 AM
rw-r--r--
📄
ResultTest.php
1.38 KB
07/10/2024 05:22:23 AM
rw-r--r--
📁
Retry
-
07/10/2024 05:24:47 AM
rwxr-xr-x
📄
RetryMiddlewareTest.php
24.57 KB
07/10/2024 05:22:23 AM
rw-r--r--
📄
RetryMiddlewareV2Test.php
40.33 KB
07/10/2024 05:22:24 AM
rw-r--r--
📁
Route53
-
07/10/2024 05:24:47 AM
rwxr-xr-x
📁
S3
-
07/10/2024 05:37:56 AM
rwxr-xr-x
📁
S3Control
-
07/10/2024 05:24:51 AM
rwxr-xr-x
📁
Script
-
07/10/2024 05:24:51 AM
rwxr-xr-x
📄
SdkTest.php
2.37 KB
07/10/2024 05:22:24 AM
rw-r--r--
📁
Ses
-
07/10/2024 05:24:51 AM
rwxr-xr-x
📁
Signature
-
07/10/2024 05:24:52 AM
rwxr-xr-x
📁
Sqs
-
07/10/2024 05:24:52 AM
rwxr-xr-x
📁
Ssm
-
07/10/2024 05:24:52 AM
rwxr-xr-x
📄
StreamRequestPayloadMiddlewareTest.php
10.1 KB
07/10/2024 05:22:24 AM
rw-r--r--
📁
Sts
-
07/10/2024 05:28:04 AM
rwxr-xr-x
📄
TestServiceTrait.php
3.78 KB
07/10/2024 05:22:24 AM
rw-r--r--
📁
Token
-
07/10/2024 05:24:54 AM
rwxr-xr-x
📄
TraceMiddlewareTest.php
16.16 KB
07/10/2024 05:22:24 AM
rw-r--r--
📄
UsesServiceTrait.php
4.37 KB
07/10/2024 05:22:24 AM
rw-r--r--
📄
WaiterTest.php
12.63 KB
07/10/2024 05:22:25 AM
rw-r--r--
📄
WrappedHttpHandlerTest.php
13.8 KB
07/10/2024 05:22:25 AM
rw-r--r--
📁
bootstrap
-
07/10/2024 05:24:30 AM
rwxr-xr-x
📄
bootstrap.php
1.53 KB
07/10/2024 05:22:21 AM
rw-r--r--
📁
fixtures
-
07/10/2024 05:37:56 AM
rwxr-xr-x
📁
static
-
07/10/2024 05:24:53 AM
rwxr-xr-x
Editing: UsesServiceTrait.php
Close
<?php namespace Aws\Test; use Aws\AwsClientInterface; use Aws\CommandInterface; use Aws\Exception\AwsException; use Aws\MockHandler; use Aws\Result; use Aws\Sdk; use Aws\Api\Service; /** * @internal */ trait UsesServiceTrait { private $_mock_handler; /** * Creates an instance of the AWS SDK for a test * * @param array $args * * @return Sdk */ private function getTestSdk(array $args = []) { return new Sdk($args + [ 'region' => 'us-east-1', 'version' => 'latest', 'retries' => 0 ]); } /** * Creates an instance of a service client for a test * * @param string $service * @param array $args * * @return AwsClientInterface */ private function getTestClient($service, array $args = []) { // Disable network access. If the INTEGRATION envvar is set, then this // disabling is not done. if (!isset($_SERVER['INTEGRATION']) && !isset($args['handler']) && !isset($args['http_handler']) ) { $this->_mock_handler = $args['handler'] = new MockHandler([]); } return $this->getTestSdk($args)->createClient($service); } /** * Queues up mock Result objects for a client * * @param AwsClientInterface $client * @param Result[]|array[] $results * @param callable $onFulfilled Callback to invoke when the return value is fulfilled. * @param callable $onRejected Callback to invoke when the return value is rejected. * * @return AwsClientInterface */ private function addMockResults( AwsClientInterface $client, array $results, callable $onFulfilled = null, callable $onRejected = null ) { foreach ($results as &$res) { if (is_array($res)) { $res = new Result($res); } } $this->_mock_handler = new MockHandler($results, $onFulfilled, $onRejected); $client->getHandlerList()->setHandler($this->_mock_handler); return $client; } private function mockQueueEmpty() { return 0 === count($this->_mock_handler); } /** * Creates a mock CommandException with a given error code * * @param string $code * @param string $type * @param string|null $message * * @return AwsException */ private function createMockAwsException( $code = null, $type = null, $message = null ) { $code = $code ?: 'ERROR'; $type = $type ?: AwsException::class; $client = $this->getMockBuilder(AwsClientInterface::class) ->setMethods(['getApi']) ->getMockForAbstractClass(); $client->expects($this->any()) ->method('getApi') ->will($this->returnValue( new Service( [ 'metadata' => [ 'endpointPrefix' => 'foo', 'apiVersion' => 'version' ] ], function () { return []; } ))); return new $type( $message ?: 'Test error', $this->getMockBuilder(CommandInterface::class)->getMock(), [ 'message' => $message ?: 'Test error', 'code' => $code ] ); } /** * Verifies an operation alias returns the expected types * * @param AwsClientInterface $client * @param string $operation * @param array $params */ private function verifyOperationAlias( $client, $operation, $params ) { $this->addMockResults($client, [new Result()]); $output = $client->{$operation}($params); if (substr($operation, -5) === 'Async') { $this->assertFalse($this->mockQueueEmpty()); $this->assertInstanceOf('GuzzleHttp\\Promise\\PromiseInterface', $output); $output = $output->wait(); $this->assertTrue($this->mockQueueEmpty()); } $this->assertInstanceOf(Result::class, $output); $this->assertTrue($this->mockQueueEmpty()); } }