Skip to content

Commit

Permalink
Use the new Aws\manifest function instead of maintaining a separate m…
Browse files Browse the repository at this point in the history
…anifest
  • Loading branch information
jeskew committed Jun 19, 2015
1 parent 507d929 commit 0c2b924
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# language: en
@elb
@elasticloadbalancing
Feature: Elastic Load Balancing

Scenario: Making a request
Expand Down
58 changes: 10 additions & 48 deletions tests/Integ/SmokeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Aws\Test\Integ;

use Aws;
use Aws\Exception\AwsException;
use Aws\JsonCompiler;
use Aws\Result;
Expand All @@ -21,39 +22,9 @@ class SmokeContext extends PHPUnit_Framework_Assert implements
{
use IntegUtils;

protected static $services = [
'cloudwatch' => [
'manifestName' => 'monitoring',
],
'cloudwatchlogs' => [
'manifestName' => 'logs',
],
'cognitoidentity' => [
'manifestName' => 'cognito-identity',
],
'cognitosync' => [
'manifestName' => 'cognito-sync',
],
'configservice' => [
'manifestName' => 'config',
],
'directoryservice' => [
'manifestName' => 'ds',
],
'efs' => [
'manifestName' => 'elasticfilesystem',
'configOverrides' => [
'region' => 'us-west-2',
],
],
'elb' => [
'manifestName' => 'elasticloadbalancing',
],
'emr' => [
'manifestName' => 'elasticmapreduce',
],
'ses' => [
'manifestName' => 'email',
protected static $configOverrides = [
'ElasticFileSystem' => [
'region' => 'us-west-2',
],
];

Expand Down Expand Up @@ -105,21 +76,12 @@ public static function prepare()
*/
public function setUp(BeforeScenarioScope $scope)
{
$configuration = [];

foreach ($scope->getFeature()->getTags() as $tag) {
$manifestName = isset(self::$services[$tag]['manifestName']) ?
self::$services[$tag]['manifestName']
: $tag;

if (isset($this->getServicesManifest()[$manifestName])) {
$this->serviceName
= $this->getServicesManifest()[$manifestName]['namespace'];

if (isset(self::$services[$tag]['configOverrides'])) {
$configuration[$this->serviceName]
= self::$services[$tag]['configOverrides'];
}
try{
$this->serviceName = Aws\manifest($tag)['namespace'];
break;
} catch (\Exception $e) {
// just in case an additional tag managed to sneak into the smoke tests
}
}

Expand All @@ -130,7 +92,7 @@ public function setUp(BeforeScenarioScope $scope)
);
}

$this->sdk = self::getSdk($configuration);
$this->sdk = self::getSdk(self::$configOverrides);

$this->client = $this->sdk->createClient($this->serviceName);
}
Expand Down

0 comments on commit 0c2b924

Please sign in to comment.