forked from aws/aws-sdk-php
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request aws#832 from jeskew/feature/move-integ-suite-to-cu…
…cumber Feature/move integ suite to cucumber
- Loading branch information
Showing
28 changed files
with
1,172 additions
and
1,462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@sqs @integ | ||
Feature: SQS Batch Serialization | ||
|
||
Scenario: Deleting Message Batches | ||
Given I have a "sqs" client | ||
And I have put 10 messages in a queue | ||
When I delete a batch of 10 messages | ||
Then 10 messages should have been deleted from the queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@dynamodb @integ | ||
Feature: DynamoDB Write Request Batch | ||
Scenario: Batching | ||
Given I have a "dynamodb" client | ||
When I create a WriteRequestBatch with a batch size of 3 and a pool size of 2 | ||
And I put 20 items in the batch | ||
And I flush the batch | ||
Then 20 items should have been written | ||
And the batch should have been flushed 7 times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@dynamodb @integ | ||
Feature: Waiters | ||
|
||
Scenario: Synchronous Waiters | ||
Given I have a "dynamodb" client | ||
And the table named "waiter-test" does not exist | ||
When I create a table named "waiter-test" | ||
And wait for the table named "waiter-test" to exist | ||
Then the table named "waiter-test" exists | ||
Then I can delete the table named "waiter-test" | ||
And wait for the table named "waiter-test" to be deleted | ||
And the table named "waiter-test" does not exist | ||
|
||
Scenario: Asynchronous Waiters | ||
Given I have a "dynamodb" client | ||
And the table named "waiter-test" does not exist | ||
When I create a promise to create and await a table named "waiter-test" | ||
And the table named "waiter-test" does not exist | ||
Then I can wait on all promises | ||
And the table named "waiter-test" exists | ||
When I create a promise to delete and await the purging of the table named "waiter-test" | ||
And the table named "waiter-test" exists | ||
Then I can wait on all promises | ||
And the table named "waiter-test" does not exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@s3 @integ | ||
Feature: Concurrent Requests | ||
|
||
Scenario: Sending a normal, synchronous request | ||
Given I have a "s3" client | ||
When I call the "ListBuckets" API | ||
Then the value at "Owner.ID" should be a "string" | ||
|
||
Scenario: Sending a promised, synchronous request | ||
Given I have a "s3" client | ||
When I call the "ListBuckets" API asynchronously | ||
And I wait on the promise | ||
Then the value at "Owner.ID" should be a "string" | ||
|
||
Scenario: Sending requests asynchronously | ||
Given a promise composed of the following asynchronous operations: | ||
| service | command | payload | | ||
| s3 | ListBuckets | | | ||
| s3 | ListBuckets | | | ||
| s3 | ListBuckets | | | ||
When I wait on the promise | ||
Then there should be 3 results | ||
And there should be 1 value at "[*].Owner.ID" | ||
|
||
Scenario: Sending commands concurrently | ||
Given a pool composed of the following commands: | ||
| service | command | payload | | ||
| s3 | ListBuckets | | | ||
| s3 | ListBuckets | | | ||
| s3 | ListBuckets | | | ||
When I send the commands as a batch to "s3" | ||
Then there should be 3 results | ||
And there should be 1 value at "[*].Owner.ID" | ||
|
||
Scenario: Sending requests asynchronously to multiple services | ||
Given a promise composed of the following asynchronous operations: | ||
| service | command | payload | | ||
| s3 | ListBuckets | | | ||
| dynamodb | ListTables | | | ||
| sqs | ListQueues | | | ||
When I wait on the promise | ||
Then there should be 3 results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@glacier @integ | ||
Feature: Glacier Multipart Uploads | ||
|
||
Scenario Outline: Uploading a stream | ||
Given I have a <seekable> read stream | ||
When I upload the stream to Glacier with a concurrency factor of "<concurrency>" | ||
Then the result should contain a(n) "location" | ||
|
||
Examples: | ||
| seekable | concurrency | | ||
| seekable | 1 | | ||
| non-seekable | 1 | | ||
| seekable | 3 | | ||
| non-seekable | 3 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@s3 @integ | ||
Feature: S3 Multipart Uploads | ||
|
||
Scenario Outline: Uploading a stream | ||
Given I have a <seekable> read stream | ||
When I upload the stream to S3 with a concurrency factor of "<concurrency>" | ||
Then the result should contain a(n) "ObjectURL" | ||
|
||
Examples: | ||
| seekable | concurrency | | ||
| seekable | 1 | | ||
| non-seekable | 1 | | ||
| seekable | 3 | | ||
| non-seekable | 3 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#language: en | ||
@s3 @integ | ||
Feature: S3 Stream Wrapper | ||
|
||
Background: | ||
Given I have a "s3" client | ||
And have registered an s3 stream wrapper | ||
|
||
Scenario: Making directories | ||
Given I create a subdirectory "subdir" with mkdir | ||
When I call is_dir on the subdir path | ||
Then the call should return true | ||
|
||
Scenario Outline: Checking existence of directories | ||
When I call is_dir on the <subdirectory> path | ||
Then the call should return <boolean> | ||
|
||
Examples: | ||
| subdirectory | boolean | | ||
| / | true | | ||
| /foo | false | | ||
| /bar | false | | ||
|
||
Scenario: Uploading Files | ||
Given I have a file at "key" with the content "testing!" | ||
When I call file_exists on the key path | ||
Then the call should return true | ||
And the file at "key" should contain "testing!" | ||
|
||
Scenario: Deleting Files | ||
Given I have a file at "key" with the content "testing!" | ||
When I call unlink on the key path | ||
And I call file_exists on the key path | ||
Then the call should return false | ||
|
||
Scenario Outline: Opening streams | ||
Given I have a file at "<path>" with the content "<contents>" | ||
And I have a read handle on the file at "<path>" | ||
Then reading 2 bytes should return <first2> | ||
And reading 1000 bytes should return <next1000> | ||
And calling fstat should report a size of <size> | ||
|
||
Examples: | ||
| path | contents | size | first2 | next1000 | | ||
| key1 | testing! | 8 | te | sting! | | ||
| key2 | foo, bar, baz | 13 | fo | o, bar, baz | | ||
|
||
Scenario: No errors raised for missing files | ||
Given I have cleared the last error | ||
When I call file_exists on the jkfdsalhjkgdfhsurew path | ||
Then the call should return false | ||
And no errors should have been raised | ||
|
||
Scenario: Traversing empty directories | ||
Given I have a file at "/empty/" with no content | ||
When I have a file at "/empty/bar" with the content "hello" | ||
Then scanning the directory at "/empty/" should return a list with one member named "bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
namespace Aws\Test\CognitoSync; | ||
|
||
use Aws\Test\UsesServiceTrait; | ||
use GuzzleHttp\Promise\FulfilledPromise; | ||
use GuzzleHttp\Psr7\Response; | ||
use Psr\Http\Message\RequestInterface; | ||
|
||
class CognitoSyncClientTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
use UsesServiceTrait; | ||
|
||
public function testRequestSucceedsWithColon() | ||
{ | ||
$identityId = 'aaa:bbb'; | ||
$identityPoolId = 'ccc:ddd'; | ||
$client = $this->getTestClient('CognitoSync', [ | ||
'http_handler' => function (RequestInterface $request) use ( | ||
$identityId, | ||
$identityPoolId | ||
) { | ||
foreach ([$identityId, $identityPoolId] as $unencodedString) { | ||
$this->assertContains( | ||
urlencode($unencodedString), | ||
(string) $request->getUri() | ||
); | ||
} | ||
|
||
return new FulfilledPromise(new Response); | ||
}, | ||
]); | ||
|
||
$client->describeIdentityUsage([ | ||
'IdentityId' => $identityId, | ||
'IdentityPoolId' => $identityPoolId, | ||
]); | ||
} | ||
} |
Oops, something went wrong.