OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
email
/
vendor
/
aws
/
aws-sdk-php
/
tests
/
Endpoint
/
UseDualstackEndpoint
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/10/2024 05:27:56 AM
rwxr-xr-x
📄
ConfigurationProviderTest.php
13.2 KB
07/10/2024 05:27:56 AM
rw-r--r--
📄
ConfigurationTest.php
1.79 KB
07/10/2024 05:27:56 AM
rw-r--r--
Editing: ConfigurationTest.php
Close
<?php namespace Aws\Test\Endpoint\UseDualstackEndpoint; use Aws\Endpoint\UseDualstackEndpoint\Configuration; use Yoast\PHPUnitPolyfills\TestCases\TestCase; /** * @covers \Aws\Endpoint\UseDualstackEndpoint\Configuration */ class ConfigurationTest extends TestCase { /** * @dataProvider correctValueCases * * @param $param * @param $expected */ public function testGetsCorrectValues($param, $expected) { $config = new Configuration($param, 'us-east-1'); $this->assertEquals($expected, $config->isuseDualstackEndpoint()); } public function correctValueCases() { return [ [true, true], [false, false], ['1', true], ['0', false], ['true', true], ['false', false], [1, true], [0, false], ]; } public function testToArray() { $config = new Configuration(true, 'us-east-1'); $expected = [ 'use_dual_stack_endpoint' => true, ]; $this->assertEquals($expected, $config->toArray()); } public function testThrowsOnInvalidEndpointsType() { $this->expectException(\Aws\Endpoint\UseDualstackEndpoint\Exception\ConfigurationException::class); $this->expectExceptionMessage("'use_dual_stack_endpoint' config option must be a boolean value"); new Configuration('not a boolean', 'us-east-1'); } public function testThrowsOnInvalidRegion() { $this->expectException(\Aws\Endpoint\UseDualstackEndpoint\Exception\ConfigurationException::class); $this->expectExceptionMessage("Dual-stack is not supported in ISO regions"); new Configuration(true, 'something-iso-something'); } }