Scalr\Service\Aws::getAvailableServiceInterfaces PHP Method

getAvailableServiceInterfaces() public method

Gets implemented web service interfaces
public getAvailableServiceInterfaces ( ) : array
return array Returns Returns the list of available (implemented) web service interfaces
    public function getAvailableServiceInterfaces()
    {
        return [self::SERVICE_INTERFACE_ELB, self::SERVICE_INTERFACE_CLOUD_WATCH, self::SERVICE_INTERFACE_CLOUD_FRONT, self::SERVICE_INTERFACE_SQS, self::SERVICE_INTERFACE_S3, self::SERVICE_INTERFACE_IAM, self::SERVICE_INTERFACE_EC2, self::SERVICE_INTERFACE_RDS, self::SERVICE_INTERFACE_ROUTE53, self::SERVICE_INTERFACE_KMS];
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @test
  * @functional
  */
 public function testGetAvailableServiceInterfaces()
 {
     $awsRefClass = new \ReflectionClass(self::CLASS_AWS);
     $available = $this->aws->getAvailableServiceInterfaces();
     $interfaces = array();
     foreach ($awsRefClass->getConstants() as $k => $v) {
         if (strpos($k, 'SERVICE_INTERFACE_') === 0) {
             $interfaces[$k] = $v;
             $this->assertContains($v, $available, 'Missing interface ' . $v . ' in available.');
         }
     }
     foreach ($interfaces as $serviceInterfaceName) {
         $instance = $this->aws->{$serviceInterfaceName};
         $this->assertInstanceOf('Scalr\\Service\\Aws\\' . ucfirst($serviceInterfaceName), $instance, 'Illegal service interface instance object');
     }
     //Test that region does not need here.
     $this->getEnvironment()->aws->iam;
 }