Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean O'Brien committed Jul 31, 2024
1 parent a9ffcbf commit c00472a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 1 addition & 3 deletions tests/S3/ExpiresParsingMiddlewareTest.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php
namespace Aws\Test\S3;

use Aws\Command;
use Aws\CommandInterface;
use Aws\Result;
use Aws\S3\ExpiresParsingMiddleware;
use Aws\Test\UsesServiceTrait;
use GuzzleHttp\Promise;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use Psr\Http\Message\RequestInterface;

/**
Expand Down
18 changes: 17 additions & 1 deletion tests/S3/S3ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2539,9 +2539,25 @@ public function testEmitsWarningWhenExpiresUnparseable()
public function testExpiresRemainsTimestamp() {
//S3 will be changing `Expires` type from `timestamp` to `string`
// soon. This test ensures backward compatibility
$apiProvider = static function () {
return [
'metadata' => [
'signatureVersion' => 'v4',
'protocol' => 'rest-xml'
],
'shapes' => [
'Expires' => [
'type' => 'string'
],
],
];
};

$s3Client = new S3Client([
'region' => 'us-west-2'
'region' => 'us-west-2',
'api_provider' => $apiProvider
]);

$api = $s3Client->getApi();
$expiresType = $api->getDefinition()['shapes']['Expires']['type'];
$this->assertEquals('timestamp', $expiresType);
Expand Down

0 comments on commit c00472a

Please sign in to comment.