Example #1
0
 /**
  * @covers Aws\Swf\SwfClient::factory
  */
 public function testFactoryInitializesClient()
 {
     $client = SwfClient::factory(array('key' => 'foo', 'secret' => 'bar', 'region' => 'us-west-2'));
     $this->assertInstanceOf('Aws\\Common\\Signature\\SignatureV4', $client->getSignature());
     $this->assertInstanceOf('Aws\\Common\\Credentials\\Credentials', $client->getCredentials());
     $this->assertEquals('https://swf.us-west-2.amazonaws.com', $client->getBaseUrl());
 }
 public function __construct()
 {
     # Check if preper env vars are setup
     if (!($region = getenv("AWS_DEFAULT_REGION"))) {
         throw new CpeSdk\CpeException("Set 'AWS_DEFAULT_REGION' environment variable!");
     }
     // SWF client
     $this->swf = SwfClient::factory(array('region' => $region));
 }