OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
aws-ses
/
vendor
/
aws
/
aws-sdk-php
/
tests
/
EndpointV2
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/14/2024 10:55:48 AM
rwxr-xr-x
📄
EndpointDefinitionProviderTest.php
2.54 KB
08/14/2024 10:52:42 AM
rw-r--r--
📄
EndpointProviderV2Test.php
14.93 KB
08/14/2024 10:52:42 AM
rw-r--r--
📄
EndpointV2MiddlewareTest.php
8.94 KB
08/14/2024 10:52:42 AM
rw-r--r--
📄
EndpointV2SerializerTraitTest.php
2.74 KB
08/14/2024 10:52:42 AM
rw-r--r--
📄
RuleCreatorTest.php
2.02 KB
08/14/2024 10:52:42 AM
rw-r--r--
📄
RulesetEndpointTest.php
1.44 KB
08/14/2024 10:52:42 AM
rw-r--r--
📄
RulesetParameterTest.php
2.04 KB
08/14/2024 10:52:42 AM
rw-r--r--
📄
RulesetStandardLibraryTest.php
9.79 KB
08/14/2024 10:52:42 AM
rw-r--r--
📁
invalid-rules
-
08/14/2024 10:55:46 AM
rwxr-xr-x
📁
test-cases
-
08/14/2024 10:55:46 AM
rwxr-xr-x
📁
valid-rules
-
08/14/2024 10:55:47 AM
rwxr-xr-x
Editing: RulesetParameterTest.php
Close
<?php namespace Aws\Test\EndpointV2; use Aws\EndpointV2\Ruleset\RulesetParameter; use Aws\Exception\UnresolvedEndpointException; use Yoast\PHPUnitPolyfills\TestCases\TestCase; /** * @covers \Aws\EndpointV2\Ruleset\RulesetParameter */ class RulesetParameterTest extends TestCase { private $rulesetParameter; protected function set_up() { $spec = [ "type" => "string", "builtIn" => "AWS::Region", "deprecated" => [ "since" => 'then', "message" => 'There is a new parameter.' ] ]; $this->rulesetParameter = new RulesetParameter('Region' ,$spec); } public function wrongParameterTypeProvider() { return [ [true], [null], [1] ]; } /** * @dataProvider wrongParameterTypeProvider * * @param $inputParameter */ public function testWrongParameterTypeThrowsException($inputParameter) { $this->expectException(UnresolvedEndpointException::class); $this->expectExceptionMessage( "Input parameter `Region` is the wrong type. Must be a String." ); $this->rulesetParameter->validateInputParam($inputParameter); } public function testDeprecatedParameterLogsError() { $this->expectWarning(); $this->expectExceptionMessage( 'Region has been deprecated since then. There is a new parameter.' ); $this->rulesetParameter->validateInputParam('us-east-1'); } public function testUnknownTypeThrowsException() { $parameterSpec = [ 'type' => 'tuple' ]; $this->expectException(UnresolvedEndpointException::class); $this->expectExceptionMessage( 'Unknown parameter type `Tuple`. ' . 'Parameters must be of type `String` or `Boolean`.' ); $rulesetParameter = new RulesetParameter('invalidType', $parameterSpec); } }