diff options
| author | Eole <EoleDev@outlook.fr> | 2016-04-27 16:42:28 +0200 |
|---|---|---|
| committer | Eole <EoleDev@outlook.fr> | 2016-04-27 16:42:28 +0200 |
| commit | 49f416dc5061032e0514ea0cfeceaca37d13e432 (patch) | |
| tree | 1202ac2a6fa860b8929afdc886c94fc50bd0a1de /server/vendor/php-opencloud/common/tests/integration/Utils.php | |
| parent | c7edd70b5e5b0f5159c78ce3d924d4e7f60db816 (diff) | |
| parent | c9202d9113210981ae47df40511645da2ee140df (diff) | |
Merge branch 'develop' into Eole_Graph
Conflicts:
client/index.html
client/js/controllers/home/home.js
client/partials/home/home.html
Diffstat (limited to 'server/vendor/php-opencloud/common/tests/integration/Utils.php')
| -rw-r--r-- | server/vendor/php-opencloud/common/tests/integration/Utils.php | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/server/vendor/php-opencloud/common/tests/integration/Utils.php b/server/vendor/php-opencloud/common/tests/integration/Utils.php deleted file mode 100644 index daa1426..0000000 --- a/server/vendor/php-opencloud/common/tests/integration/Utils.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -namespace OpenCloud\integration; - -use GuzzleHttp\Client; -use OpenCloud\Identity\v2\Api; -use OpenCloud\Identity\v2\Service; -use OpenCloud\Common\Transport\HandlerStack; -use OpenCloud\Common\Transport\Utils as CommonUtils; - -class Utils -{ - public static function getAuthOptsV3() - { - return [ - 'authUrl' => getenv('OS_AUTH_URL'), - 'region' => getenv('OS_REGION_NAME'), - 'user' => [ - 'id' => getenv('OS_USER_ID'), - 'password' => getenv('OS_PASSWORD'), - ], - 'scope' => [ - 'project' => [ - 'id' => getenv('OS_PROJECT_ID'), - ] - ] - ]; - } - - public static function getAuthOptsV2() - { - $httpClient = new Client([ - 'base_uri' => CommonUtils::normalizeUrl(getenv('OS_AUTH_URL')), - 'handler' => HandlerStack::create(), - ]); - return [ - 'authUrl' => getenv('OS_AUTH_URL'), - 'region' => getenv('OS_REGION_NAME'), - 'username' => getenv('OS_USERNAME'), - 'password' => getenv('OS_PASSWORD'), - 'tenantName' => getenv('OS_TENANT_NAME'), - 'identityService' => new Service($httpClient, new Api), - ]; - } - - public static function getAuthOpts(array $options = []) - { - $authOptions = getenv('OS_IDENTITY_API_VERSION') == '2.0' - ? self::getAuthOptsV2() - : self::getAuthOptsV3(); - - return array_merge($authOptions, $options); - } - - public static function toCamelCase($word, $separator = '_') - { - return str_replace($separator, '', ucwords($word, $separator)); - } -} |
