protected function awsConnect() { if (is_object($this->s3Client)) { return $this->s3Client; } if (!strlen($this->bucketName)) { throw new \Exception('Missing Bucket Name'); } $s3credentials = array('key' => $this->awsApiKey, 'secret' => $this->awsSecretKey, 'region' => $this->awsRegion); $token = $this->awsToken; if (strlen($token)) { $s3credentials['token'] = $token; } print_r($s3credentials); $this->s3Client = s3Client::factory($s3credentials); return $this->s3Client; }
/** * @covers Aws\S3\S3Client::isValidBucketName * @dataProvider bucketNameProvider */ public function testValidatesBucketNames($bucketName, $isValid) { $this->assertEquals($isValid, s3Client::isValidBucketName($bucketName)); }