OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
knoblyExpressLandingPage
/
vendor
/
aws
/
aws-sdk-php
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/21/2024 10:02:53 AM
rwxr-xr-x
📄
AbstractConfigurationProviderTest.php
3.42 KB
08/21/2024 10:02:26 AM
rw-r--r--
📁
Api
-
08/21/2024 10:11:35 AM
rwxr-xr-x
📁
Arn
-
08/21/2024 10:05:32 AM
rwxr-xr-x
📁
Auth
-
08/21/2024 10:03:48 AM
rwxr-xr-x
📄
AwsClientTest.php
29.67 KB
08/21/2024 10:02:26 AM
rw-r--r--
📁
Build
-
08/21/2024 10:05:32 AM
rwxr-xr-x
📄
ClientResolverTest.php
55.74 KB
08/21/2024 10:02:26 AM
rw-r--r--
📁
ClientSideMonitoring
-
08/21/2024 10:03:49 AM
rwxr-xr-x
📁
CloudFront
-
08/21/2024 10:05:32 AM
rwxr-xr-x
📁
CloudSearchDomain
-
08/21/2024 10:03:49 AM
rwxr-xr-x
📁
CloudTrail
-
08/21/2024 10:03:49 AM
rwxr-xr-x
📁
CloudWatchLogs
-
08/21/2024 10:03:50 AM
rwxr-xr-x
📁
CognitoIdentity
-
08/21/2024 10:03:50 AM
rwxr-xr-x
📁
CognitoSync
-
08/21/2024 10:03:50 AM
rwxr-xr-x
📄
CommandPoolTest.php
5.8 KB
08/21/2024 10:02:26 AM
rw-r--r--
📄
CommandTest.php
3.28 KB
08/21/2024 10:02:26 AM
rw-r--r--
📄
ConfigurationResolverTest.php
12.35 KB
08/21/2024 10:02:26 AM
rw-r--r--
📁
Credentials
-
08/21/2024 10:11:26 AM
rwxr-xr-x
📁
Crypto
-
08/21/2024 10:05:32 AM
rwxr-xr-x
📁
DefaultsMode
-
08/21/2024 10:03:51 AM
rwxr-xr-x
📁
DocDb
-
08/21/2024 10:03:51 AM
rwxr-xr-x
📄
DoctrineCacheAdapterTest.php
1.23 KB
08/21/2024 10:02:26 AM
rw-r--r--
📁
DynamoDb
-
08/21/2024 10:03:52 AM
rwxr-xr-x
📁
Ec2
-
08/21/2024 10:03:52 AM
rwxr-xr-x
📁
ElasticLoadBalancingV2
-
08/21/2024 10:03:52 AM
rwxr-xr-x
📁
Endpoint
-
08/21/2024 10:05:33 AM
rwxr-xr-x
📁
EndpointDiscovery
-
08/21/2024 10:11:36 AM
rwxr-xr-x
📄
EndpointParameterMiddlewareTest.php
9.21 KB
08/21/2024 10:02:26 AM
rw-r--r--
📁
EndpointV2
-
08/21/2024 10:05:34 AM
rwxr-xr-x
📁
EventBridge
-
08/21/2024 10:03:53 AM
rwxr-xr-x
📁
Exception
-
08/21/2024 10:03:53 AM
rwxr-xr-x
📄
FunctionsTest.php
14.33 KB
08/21/2024 10:02:26 AM
rw-r--r--
📁
Glacier
-
08/21/2024 10:03:53 AM
rwxr-xr-x
📁
Handler
-
08/21/2024 10:05:34 AM
rwxr-xr-x
📄
HandlerListTest.php
7.16 KB
08/21/2024 10:02:26 AM
rw-r--r--
📄
HasMonitoringEventsTraitTest.php
895 bytes
08/21/2024 10:02:27 AM
rw-r--r--
📄
HashingStreamTest.php
1.41 KB
08/21/2024 10:02:26 AM
rw-r--r--
📄
HistoryTest.php
4.2 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
IdempotencyTokenMiddlewareTest.php
2.76 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Identity
-
08/21/2024 10:05:35 AM
rwxr-xr-x
📄
InputValidationMiddlewareTest.php
5.62 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Integ
-
08/21/2024 10:03:54 AM
rwxr-xr-x
📄
JsonCompilerTest.php
730 bytes
08/21/2024 10:02:27 AM
rw-r--r--
📁
Lambda
-
08/21/2024 10:03:54 AM
rwxr-xr-x
📁
LexModelsV2
-
08/21/2024 10:03:54 AM
rwxr-xr-x
📄
LruArrayCacheTest.php
1.59 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
MachineLearning
-
08/21/2024 10:03:54 AM
rwxr-xr-x
📄
MiddlewareTest.php
16.08 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
MockHandlerTest.php
3.79 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
MultiRegionClientTest.php
5.41 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Multipart
-
08/21/2024 10:03:55 AM
rwxr-xr-x
📁
Neptune
-
08/21/2024 10:03:55 AM
rwxr-xr-x
📄
PerformanceContext.php
8.2 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
PhpHashTest.php
1.33 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Polly
-
08/21/2024 10:03:55 AM
rwxr-xr-x
📄
PresignUrlMiddlewareTest.php
3.95 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
Psr16CacheAdapterTest.php
1.84 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
PsrCacheAdapterTest.php
2.64 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
QueryCompatibleInputMiddlewareTest.php
9.1 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Rds
-
08/21/2024 10:03:55 AM
rwxr-xr-x
📁
RequestCompression
-
08/21/2024 10:05:35 AM
rwxr-xr-x
📄
ResultPaginatorTest.php
16.21 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
ResultTest.php
1.38 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Retry
-
08/21/2024 10:03:55 AM
rwxr-xr-x
📄
RetryMiddlewareTest.php
24.57 KB
08/21/2024 10:02:27 AM
rw-r--r--
📄
RetryMiddlewareV2Test.php
40.33 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Route53
-
08/21/2024 10:03:56 AM
rwxr-xr-x
📁
S3
-
08/21/2024 10:11:36 AM
rwxr-xr-x
📁
S3Control
-
08/21/2024 10:03:57 AM
rwxr-xr-x
📁
Script
-
08/21/2024 10:03:57 AM
rwxr-xr-x
📄
SdkTest.php
2.37 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Ses
-
08/21/2024 10:03:57 AM
rwxr-xr-x
📁
Signature
-
08/21/2024 10:03:58 AM
rwxr-xr-x
📁
Sqs
-
08/21/2024 10:03:58 AM
rwxr-xr-x
📁
Ssm
-
08/21/2024 10:03:58 AM
rwxr-xr-x
📄
StreamRequestPayloadMiddlewareTest.php
10.1 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Sts
-
08/21/2024 10:05:36 AM
rwxr-xr-x
📄
TestServiceTrait.php
3.78 KB
08/21/2024 10:02:27 AM
rw-r--r--
📁
Token
-
08/21/2024 10:03:58 AM
rwxr-xr-x
📄
TraceMiddlewareTest.php
16.16 KB
08/21/2024 10:02:28 AM
rw-r--r--
📄
UsesServiceTrait.php
4.37 KB
08/21/2024 10:02:28 AM
rw-r--r--
📄
WaiterTest.php
12.63 KB
08/21/2024 10:02:28 AM
rw-r--r--
📄
WrappedHttpHandlerTest.php
13.8 KB
08/21/2024 10:02:28 AM
rw-r--r--
📁
bootstrap
-
08/21/2024 10:03:49 AM
rwxr-xr-x
📄
bootstrap.php
1.53 KB
08/21/2024 10:02:26 AM
rw-r--r--
📁
fixtures
-
08/21/2024 10:11:36 AM
rwxr-xr-x
📁
static
-
08/21/2024 10:03:58 AM
rwxr-xr-x
Editing: HandlerListTest.php
Close
<?php namespace Aws\Test; use Aws\Command; use Aws\CommandInterface; use Aws\HandlerList; use Aws\Middleware; use GuzzleHttp\Psr7\Request; use Yoast\PHPUnitPolyfills\TestCases\TestCase; /** * @covers Aws\HandlerList */ class HandlerListTest extends TestCase { public function testEnsuresHandlerIsSet() { $this->expectException(\LogicException::class); $list = new HandlerList(); $this->assertFalse($list->hasHandler()); $list->resolve(); } public function testHandlerCanBeSetInCtor() { $handler = function () {}; $list = new HandlerList($handler); $this->assertTrue($list->hasHandler()); $this->assertSame($handler, $list->resolve()); } public function testHandlerCanBeSetInSetter() { $handler = function () {}; $list = new HandlerList(); $list->setHandler($handler); $this->assertTrue($list->hasHandler()); $this->assertSame($handler, $list->resolve()); } public function testCanPrependWithName() { $list = new HandlerList(); $list->prependInit(function () {}, 'foo'); $this->assertCount(1, $list); } public function testCanRemoveByInstance() { $handler = function () {}; $list = new HandlerList($handler); $middleware = function () { return function () {}; }; $list->appendInit($middleware); $this->assertCount(1, $list); $this->assertNotSame($handler, $list->resolve()); $list->remove($middleware); $this->assertCount(0, $list); $this->assertSame($handler, $list->resolve()); } /** @doesNotPerformAssertions */ public function testIgnoreWhenNameNotFound() { $list = new HandlerList(); $list->remove('foo'); } public function testCanRemoveByName() { $handler = function () {}; $list = new HandlerList($handler); $middleware = function () { return function () {}; }; $list->appendInit($middleware, 'foo'); $this->assertCount(1, $list); $this->assertNotSame($handler, $list->resolve()); $list->remove('foo'); $this->assertCount(0, $list); $this->assertSame($handler, $list->resolve()); } private function createMiddleware(array &$history, $name) { return function (callable $next) use (&$history, $name) { return function (CommandInterface $cmd, $request = null) use ($next, &$history, $name) { $history[] = $name; return $next($cmd, $request); }; }; } public function testWrapsInStepOrderWithAppend() { $handler = function (CommandInterface $cmd, $request = null) { return 'baz'; }; $list = new HandlerList($handler); $h = []; $steps = ['Init', 'Validate', 'Build', 'Sign', 'Attempt']; foreach ($steps as $step) { $m = $this->createMiddleware($h, $step); $list->{'append' . $step}($m); } $built = $list->resolve(); $cmd = new Command('foo'); $this->assertSame('baz', $built($cmd)); $this->assertEquals($steps, $h); } public function testWrapsInStepOrderWithPrepend() { $handler = function (CommandInterface $cmd, $request = null) { return 'baz'; }; $list = new HandlerList($handler); $h = []; $steps = ['Init', 'Validate', 'Build', 'Sign', 'Attempt']; foreach ($steps as $step) { $m = $this->createMiddleware($h, $step); $list->{'prepend' . $step}($m); } $built = $list->resolve(); $cmd = new Command('foo'); $this->assertSame('baz', $built($cmd)); $this->assertEquals($steps, $h); } public function testCanPrintStack() { $list = new HandlerList(); $list->appendInit(function () {}, 'foo'); $list->appendInit([$this, 'bar'], 'bar'); $list->appendValidate(__CLASS__ . '::foo'); $list->appendSign([Middleware::class, 'tap'], 'baz'); $list->setHandler(function () {}); $lines = explode("\n", (string) $list); $this->assertCount(6, $lines); $this->assertStringContainsString('0) Step: init, Name: foo, Function: callable(', $lines[0]); $this->assertSame("1) Step: init, Name: bar, Function: callable(['" . HandlerListTest::class . "', 'bar'])", $lines[1]); $this->assertSame('2) Step: validate, Function: callable(' . HandlerListTest::class . '::foo)', $lines[2]); $this->assertSame("3) Step: sign, Name: baz, Function: callable(['" . Middleware::class . "', 'tap'])", $lines[3]); $this->assertStringContainsString('4) Handler: callable(', $lines[4]); } public static function foo() {} public function bar() {} public function testCanAddBefore() { $list = new HandlerList(); $list->appendInit(function () {}); $list->appendBuild(function () {}, 'test'); $list->before('test', 'a', function () {}); $lines = explode("\n", (string) $list); $this->assertStringContainsString("1) Step: build, Name: a", $lines[1]); $this->assertStringContainsString("2) Step: build, Name: test", $lines[2]); } public function testCanAddAfter() { $list = new HandlerList(); $list->appendBuild(function () {}, 'test'); $list->appendBuild(function () {}, 'after_test'); $list->appendInit(function () {}); $list->after('test', 'a', function () {}); $lines = explode("\n", (string) $list); $this->assertStringContainsString("1) Step: build, Name: test", $lines[1]); $this->assertStringContainsString("2) Step: build, Name: a", $lines[2]); $this->assertStringContainsString("3) Step: build, Name: after_test", $lines[3]); } public function testMustExistByNameToPrependOrAppend() { $this->expectException(\InvalidArgumentException::class); $list = new HandlerList(); $list->before('foo', '', function () {}); } public function testCanInterposeMiddleware() { $list = new HandlerList(function () {}); $list->appendInit(Middleware::tap(function () {}), 'a'); $list->appendValidate(Middleware::tap(function () {}), 'b'); $list->appendBuild(Middleware::tap(function () {}), 'c'); $list->appendSign(Middleware::tap(function () {}), 'd'); $list->appendAttempt(Middleware::tap(function (){}), 'e'); $list->interpose(function ($step, $name) use (&$res) { return function (callable $h) use ($step, $name, &$res) { return function ($c, $r) use ($h, $step, $name, &$res) { $res[] = "$step:$name"; return $h($c, $r); }; }; }); $handler = $list->resolve(); $handler(new Command('foo'), new Request('GET', 'http://foo.com')); $this->assertEquals(['init:a', 'validate:b', 'build:c', 'sign:d', 'attempt:e'], $res); } }