OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
zzXpress
/
vendor
/
aws
/
aws-sdk-php
/
tests
/
Api
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:24 AM
rwxr-xr-x
📄
ApiProviderTest.php
4.29 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
DateTimeResultTest.php
1.58 KB
05/19/2025 10:07:24 AM
rw-r--r--
📁
ErrorParser
-
05/19/2025 10:07:24 AM
rwxr-xr-x
📄
ListShapeTest.php
786 bytes
05/19/2025 10:07:24 AM
rw-r--r--
📄
MapShapeTest.php
1.15 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
OperationTest.php
3.93 KB
05/19/2025 10:07:24 AM
rw-r--r--
📁
Parser
-
05/19/2025 10:07:24 AM
rwxr-xr-x
📁
Serializer
-
05/19/2025 10:07:24 AM
rwxr-xr-x
📄
ServiceTest.php
9.2 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
ShapeMapTest.php
949 bytes
05/19/2025 10:07:24 AM
rw-r--r--
📄
ShapeTest.php
2.97 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
Stringable.php
137 bytes
05/19/2025 10:07:24 AM
rw-r--r--
📄
StructureShapeTest.php
1.62 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
TimestampShapeTest.php
1.89 KB
05/19/2025 10:07:24 AM
rw-r--r--
📄
ValidatorTest.php
24.8 KB
05/19/2025 10:07:24 AM
rw-r--r--
📁
api_provider_fixtures
-
11/13/2024 03:03:34 PM
rwxr-xr-x
📁
eventstream_fixtures
-
11/13/2024 03:02:20 PM
rwxr-xr-x
📁
test_cases
-
11/13/2024 03:04:14 PM
rwxr-xr-x
Editing: ShapeTest.php
Close
<?php namespace Aws\Test\Api; use Aws\Api\Shape; use Aws\Api\ShapeMap; use Yoast\PHPUnitPolyfills\TestCases\TestCase; /** * @covers Aws\Api\Shape * @covers Aws\Api\AbstractModel */ class ShapeTest extends TestCase { public function testImplementsArray() { $s = new Shape(['metadata' => ['foo' => 'bar']], new ShapeMap([])); $this->assertSame(['foo' => 'bar'], $s['metadata']); $this->assertNull($s['missing']); $s['abc'] = '123'; $this->assertSame('123', $s['abc']); $this->assertArrayHasKey('abc', $s); $this->assertEquals( ['metadata' => ['foo' => 'bar'], 'abc' => '123'], $s->toArray() ); unset($s['abc']); $this->assertArrayNotHasKey('abc', $s); } public function testValidatesShapeAt() { $this->expectException(\InvalidArgumentException::class); $s = new Shape([], new ShapeMap([])); $m = new \ReflectionMethod($s, 'shapeAt'); $m->setAccessible(true); $m->invoke($s, 'not_there'); } public function testReturnsShapesFor() { $s = new Shape(['foo' => ['type' => 'string']], new ShapeMap([])); $m = new \ReflectionMethod($s, 'shapeAt'); $m->setAccessible(true); $this->assertInstanceOf(Shape::class, $m->invoke($s, 'foo')); } public function testReturnsNestedShapeReferences() { $s = new Shape( ['foo' => ['shape' => 'bar']], new ShapeMap(['bar' => ['type' => 'string']]) ); $m = new \ReflectionMethod($s, 'shapeAt'); $m->setAccessible(true); $result = $m->invoke($s, 'foo'); $this->assertInstanceOf(Shape::class, $result); $this->assertSame('string', $result->getType()); } public function testCreatesNestedShapeReferences() { $s = Shape::create( ['shape' => 'bar'], new ShapeMap(['bar' => ['type' => 'float']]) ); $this->assertInstanceOf(Shape::class, $s); $this->assertSame('float', $s->getType()); } public function testValidatesShapeTypes() { $this->expectExceptionMessage("Invalid type"); $this->expectException(\RuntimeException::class); $s = new Shape( ['foo' => ['type' => 'what?']], new ShapeMap([]) ); $m = new \ReflectionMethod($s, 'shapeAt'); $m->setAccessible(true); $m->invoke($s, 'foo'); } public function testGetContextParam() { $s = new Shape( [ 'foo' => [ 'shape' => 'bar', ], 'contextParam' => [ 'name' => 'Baz' ] ], new ShapeMap(['bar' => ['type' => 'string']]) ); $this->assertEquals( ['name' => 'Baz'], $s->getContextParam() ); } }