From 54ec6723deb44e325782afd366eeec01ee29ac55 Mon Sep 17 00:00:00 2001 From: EoleDev Date: Wed, 23 Mar 2016 15:30:47 +0100 Subject: Maj Library --- .../common/tests/integration/DefaultLogger.php | 2 +- .../common/tests/integration/Runner.php | 12 +++--- .../tests/integration/SampleManagerInterface.php | 2 +- .../common/tests/integration/TestCase.php | 2 +- .../common/tests/integration/TestInterface.php | 2 +- .../common/tests/integration/Utils.php | 48 +--------------------- .../php-opencloud/common/tests/integration/run.php | 10 ----- 7 files changed, 12 insertions(+), 66 deletions(-) delete mode 100644 server/vendor/php-opencloud/common/tests/integration/run.php (limited to 'server/vendor/php-opencloud/common/tests/integration') diff --git a/server/vendor/php-opencloud/common/tests/integration/DefaultLogger.php b/server/vendor/php-opencloud/common/tests/integration/DefaultLogger.php index a546c70..d367600 100644 --- a/server/vendor/php-opencloud/common/tests/integration/DefaultLogger.php +++ b/server/vendor/php-opencloud/common/tests/integration/DefaultLogger.php @@ -1,6 +1,6 @@ basePath = $basePath; + $this->namespace = $testNamespace; + $this->logger = new DefaultLogger(); $this->assembleServicesFromSamples(); } @@ -73,15 +76,14 @@ class Runner */ private function getTest($serviceName, $version, $verbosity) { - $namespace = (new \ReflectionClass($this))->getNamespaceName(); - $className = sprintf("%s\\%s\\%sTest", $namespace, Utils::toCamelCase($serviceName), ucfirst($version)); + $className = sprintf("%s\\%s\\%sTest", $this->namespace, Utils::toCamelCase($serviceName), ucfirst($version)); if (!class_exists($className)) { throw new \RuntimeException(sprintf("%s does not exist", $className)); } $basePath = $this->basePath . DIRECTORY_SEPARATOR . $serviceName . DIRECTORY_SEPARATOR . $version; - $smClass = sprintf("%s\\SampleManager", $namespace); + $smClass = sprintf("%s\\SampleManager", $this->namespace); $class = new $className($this->logger, new $smClass($basePath, $verbosity)); if (!($class instanceof TestInterface)) { diff --git a/server/vendor/php-opencloud/common/tests/integration/SampleManagerInterface.php b/server/vendor/php-opencloud/common/tests/integration/SampleManagerInterface.php index f0fe848..c4293ba 100644 --- a/server/vendor/php-opencloud/common/tests/integration/SampleManagerInterface.php +++ b/server/vendor/php-opencloud/common/tests/integration/SampleManagerInterface.php @@ -1,6 +1,6 @@ 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)); diff --git a/server/vendor/php-opencloud/common/tests/integration/run.php b/server/vendor/php-opencloud/common/tests/integration/run.php deleted file mode 100644 index 5bc5548..0000000 --- a/server/vendor/php-opencloud/common/tests/integration/run.php +++ /dev/null @@ -1,10 +0,0 @@ -runServices(); -- cgit v1.2.3