* * The Auspost API Client Library for PHP is free software: you can redistribute * it and/or modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * The Auspost API Client Library for PHP is distributed in the hope that it * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the Auspost API Client Library for PHP. If not, see * <http://www.gnu.org/licenses/>. * * @category Fontis * @package auspost-api-php * @author Thai Phan * @copyright Copyright (c) 2013 Fontis Pty Ltd (http://www.fontis.com.au) * @license http://opensource.org/licenses/LGPL-3.0 GNU Lesser General Public License (LGPL 3.0) */ // Include the composer autoloader $loader = (require dirname(__DIR__) . '/vendor/autoload.php'); $loader->add('Auspost\\Tests', __DIR__); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); // Instantiate the service builder $auspost = \Auspost\Common\Auspost::factory(array('developer_mode' => true)); // Configure the tests to use the instantiated Auspost service builder Guzzle\Tests\GuzzleTestCase::setServiceBuilder($auspost);
<?php if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install\n\n" . "See http://getcomposer.org for help with installing composer\n"); } $loader = (require dirname(__DIR__) . '/vendor/autoload.php'); $loader->add('ImageRelay\\Test', __DIR__); Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('imagerelay' => array('class' => 'ImageRelay\\ImageRelayClient', 'params' => array('auth' => 'http', 'username' => 'username', 'password' => 'password', 'app_name' => 'Test', 'app_contact' => 'https://www.test.com', 'imagerelay_url' => 'test.imagerelay.com')))));
* Cowardly stolen from Apostle-php * https://github.com/sitepoint/apostle-php/blob/master/tests/bootstrap.php */ error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.lock')) { die("Dependencies must be installed using composer:\n\ncomposer.phar install --dev\n\n" . "See https://github.com/composer/composer/blob/master/README.md for help with installing composer\n"); } require_once 'PHPUnit/TextUI/TestRunner.php'; // Register an autoloader for the client being tested spl_autoload_register(function ($class) { if (0 === strpos($class, 'Apostle')) { $class = str_replace('Apostle', '', $class); if ('\\' != DIRECTORY_SEPARATOR) { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Apostle' . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; } else { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Apostle' . DIRECTORY_SEPARATOR . $class . '.php'; } if (file_exists($class)) { require $class; return true; } } return false; }); // Include the composer autoloader $loader = (require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . DIRECTORY_SEPARATOR . 'mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('queue' => array('class' => 'Apostle\\Queue', 'params' => array('domain' => 'apostle.example.org')))));
<?php $loader = (require __DIR__ . '/../vendor/autoload.php'); $loader->add('AdrienBrault', __DIR__); Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(\Guzzle\Service\Builder\ServiceBuilder::factory(array('facebook' => array('class' => 'AdrienBrault\\FacebookClient\\FacebookClient'))));
<?php if (!($loader = (include __DIR__ . '/../vendor/autoload.php'))) { die(<<<EOT You need to install the project dependencies using Composer: \$ curl -s https://getcomposer.org/installer | php \$ php composer.phar install --dev \$ ./bin/phpunit EOT ); } $loader->add('Clearbit\\Tests', __DIR__); // Service Builder for tests Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(['clearbit' => ['class' => 'Clearbit\\Client', 'params' => ['api_token' => $_SERVER['API_TOKEN']]]]));
<?php error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n" . "See http://getcomposer.org for help with installing composer\n"); } require_once 'PHPUnit/TextUI/TestRunner.php'; // Include the phar files if testing against the phars if (get_cfg_var('guzzle_phar')) { require get_cfg_var('guzzle_phar'); } // Include the composer autoloader $autoloader = (require_once dirname(__DIR__) . '/vendor/autoload.php'); // Add the services file to the default service builder $servicesFile = __DIR__ . '/Guzzle/Tests/TestData/services/services.xml'; Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory($servicesFile)); // Modify the include path so that it can find the Zend Framework $paths = array('vendor/zend/zend-cache1', 'vendor/zend/zend-log1'); set_include_path(implode(PATH_SEPARATOR, array_map(function ($path) { return __DIR__ . '/../' . $path; }, $paths)) . PATH_SEPARATOR . get_include_path());
<?php error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n See http://getcomposer.org for help with installing composer\n"); } // Include the composer autoloader $autoloader = (require dirname(__DIR__) . '/vendor/autoload.php'); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mocks'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(\Guzzle\Service\Builder\ServiceBuilder::factory(array('test' => array('class' => 'Gencoding\\Guzzle\\Encoding\\EncodingClient', 'params' => array('base_url' => 'http://localhost', 'userid' => 'xx', 'userkey' => 'xx')))));
<?php $loader = (require __DIR__ . '/../vendor/autoload.php'); /** @var $loader \Composer\Autoload\ClassLoader */ $loader->add('AdrienBrault\\ItunesClient\\Tests', __DIR__); Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mocks'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('itunes_client' => array('class' => 'AdrienBrault\\ItunesClient\\ItunesClient', 'params' => array('country' => 'us')))));
<?php error_reporting(E_ALL | E_STRICT); require_once 'PHPUnit/TextUI/TestRunner.php'; require dirname(__DIR__) . '/vendor/autoload.php'; if (isset($GLOBALS['monolog_on']) && $GLOBALS['monolog_on']) { $log = new \Monolog\Logger('Log'); $log->pushHandler(new \Monolog\Handler\StreamHandler($GLOBALS['monolog_log'])); } else { $log = FALSE; } // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . DIRECTORY_SEPARATOR . 'mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('client' => array('class' => 'HealthGraph\\HealthGraphClient', 'params' => array('logger' => $log)))));
} // Include the phar files if testing against the phars if (get_cfg_var('aws_phar')) { require dirname(__DIR__) . '/build/' . get_cfg_var('aws_phar'); } // Include the composer autoloader $loader = (require dirname(__DIR__) . '/vendor/autoload.php'); $loader->add('Aws\\Test', __DIR__); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); // Allow command line overrides if (get_cfg_var('CONFIG')) { $_SERVER['CONFIG'] = get_cfg_var('CONFIG'); } // Set the service configuration file if it was not provided from the CLI if (!isset($_SERVER['CONFIG'])) { $serviceConfig = $_SERVER['CONFIG'] = dirname(__DIR__) . '/test_services.json'; $_SERVER['CONFIG'] = $serviceConfig; if (!file_exists($serviceConfig)) { die("test_services.json does not exist.\n" . "Please run phing test-init or copy test_services.json.dist to test_services.json\n\n"); } } if (!is_readable($_SERVER['CONFIG'])) { die("Unable to read service configuration from '{$_SERVER['CONFIG']}'\n"); } // If the global prefix is hostname, then use the crc32() of gethostname() if (!isset($_SERVER['PREFIX']) || $_SERVER['PREFIX'] == 'hostname') { $_SERVER['PREFIX'] = crc32(gethostname()); } Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Aws\Common\Aws::factory($_SERVER['CONFIG']));
<?php error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.lock')) { die("Dependencies must be installed using composer:\n\ncomposer.phar install --install-suggests\n\n" . "See https://github.com/composer/composer/blob/master/README.md for help with installing composer\n"); } require_once 'PHPUnit/TextUI/TestRunner.php'; // Register an autoloader for the client being tested spl_autoload_register(function ($class) { if (0 === strpos($class, 'Guzzle\\RottenTomatoes')) { $class = str_replace('Guzzle\\RottenTomatoes', '', $class); if ('\\' != DIRECTORY_SEPARATOR) { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Guzzle/RottenTomatoes' . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; } else { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Guzzle/RottenTomatoes' . DIRECTORY_SEPARATOR . $class . '.php'; } if (file_exists($class)) { require $class; } } }); // Include the composer autoloader $loader = (require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . DIRECTORY_SEPARATOR . 'mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('client' => array('class' => 'Theodo\\Client\\Esendex\\EsendexClient', 'params' => array('account' => $_SERVER['ACCOUNT'], 'username' => $_SERVER['USERNAME'], 'password' => $_SERVER['PASSWORD'])))));
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --------------------------------------------------------------------- */ require_once 'vendor/autoload.php'; use Guzzle\Http\Client; function newServiceBuilder() { $user = creat_user(); return Aws\Common\Aws::factory($_SERVER['CONFIG'], array('key' => $user['key_id'], 'secret' => $user['key_secret'], 'curl.options' => array('CURLOPT_PROXY' => 'localhost:' . cs_port()))); } function creat_user() { $name = uniqid('riakcs-'); $client = new Client('http://*****:*****@example.com\"}"); return $request->send()->json(); } function cs_port() { return getenv('CS_HTTP_PORT') ? getenv('CS_HTTP_PORT') : 8080; } Guzzle\Tests\GuzzleTestCase::setServiceBuilder(newServiceBuilder());
<?php // Ensure that composer has installed all dependencies if (!file_exists(__DIR__ . '/../composer.lock')) { die("Dependencies must be installed using composer:\n\ncomposer.phar install --dev\n\n" . "See https://github.com/composer/composer/blob/master/README.md for help with installing composer\n"); } // Include the composer autoloader $loader = (require __DIR__ . '/../vendor/autoload.php'); $loader->add('Gridonic\\Guzzle\\SmsBox\\Tests', __DIR__); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(\Guzzle\Service\Builder\ServiceBuilder::factory(array('test.smsbox' => array('class' => 'Gridonic.Guzzle.SmsBox.SmsBoxClient', 'params' => array('base_url' => 'http://biz.smsbox.ch:8047/723/sms/xml', 'username' => 'admin', 'password' => 'smsbox')))));
<?php error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.lock')) { die("Dependencies must be installed using composer:\n\ncomposer.phar install --dev\n\n" . "See https://github.com/composer/composer/blob/master/README.md for help with installing composer\n"); } require_once 'PHPUnit/TextUI/TestRunner.php'; // Register an autoloader for the client being tested spl_autoload_register(function ($class) { if (0 === strpos($class, 'CMV\\GoogleBooks')) { $class = str_replace('CMV\\GoogleBooks', '', $class); if ('\\' != DIRECTORY_SEPARATOR) { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'CMV/GoogleBooks' . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; } else { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'CMV\\GoogleBooks' . DIRECTORY_SEPARATOR . $class . '.php'; } if (file_exists($class)) { require $class; return true; } } return false; }); // Include the composer autoloader $loader = (require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . DIRECTORY_SEPARATOR . 'mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('client' => array('class' => 'CMV\\GoogleBooks\\GoogleBooksClient'))));
<?php error_reporting(E_ALL | E_STRICT); if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n" . "See http://getcomposer.org for help with installing composer\n"); } $autoloader = (require dirname(__DIR__) . '/vendor/autoload.php'); $alfrescoData = __DIR__ . '/ifresco/Tests/AlfrescoData/service.json'; $data = json_decode(file_get_contents($alfrescoData)); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('test.ifresco' => array('class' => 'ifresco\\Service\\Client', 'params' => array('host' => $data->host, 'username' => $data->user, 'password' => $data->pass)))));
<?php if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install\n\n" . "See http://getcomposer.org for help with installing composer\n"); } $loader = (require dirname(__DIR__) . '/vendor/autoload.php'); $loader->add('Mtxserv\\Test', __DIR__); Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/Mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('mtxserv' => array('class' => 'Mtxserv\\Client', 'params' => array('client_id' => 'client_id', 'client_secret' => 'client_secret', 'api_key' => 'client_api_key', 'has_authentification' => false)))));
<?php /* * (c) Netvlies Internetdiensten * * Richard van den Brand <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install\n\n" . "See http://getcomposer.org for help with installing composer\n"); } $loader = (require dirname(__DIR__) . '/vendor/autoload.php'); $loader->add('Basecamp\\Test', __DIR__); Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('basecamp' => array('class' => 'Basecamp\\BasecampClient', 'params' => array('auth' => 'http', 'username' => 'test_user', 'password' => '****', 'user_id' => '99999999', 'app_name' => 'Basecamp PHP Test', 'app_contact' => 'https://github.com/netvlies/basecamp-php')))));
<?php /* * This file is part of the php-ga-measurement-protocol package. * * (c) Kristian Zondervan <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install\n\n" . "See http://getcomposer.org for help with installing composer\n"); } $loader = (require dirname(__DIR__) . '/vendor/autoload.php'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('ga_measurement_protocol' => array('class' => 'Krizon\\Google\\Analytics\\MeasurementProtocol\\MeasurementProtocolClient', 'params' => array()))));
<?php error_reporting(E_ALL | E_STRICT); $loader = (require __DIR__ . '/../vendor/autoload.php'); $loader->add('SheKnows\\OoyalaApi', dirname(__DIR__) . '/src'); $loader->add('SheKnows\\OoyalaApi\\Tests', dirname(__DIR__) . '/tests'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('live.ooyala-client' => array('class' => 'SheKnows\\OoyalaApi\\OoyalaClient', 'params' => array('api_key' => $_SERVER['API_KEY'], 'api_secret' => $_SERVER['API_SECRET'], 'request.options' => array('timeout' => 0, 'connect_timeout' => 0))), 'cdn.ooyala-client' => array('class' => 'SheKnows\\OoyalaApi\\OoyalaClient', 'params' => array('api_key' => $_SERVER['API_KEY'], 'api_secret' => $_SERVER['API_SECRET'], 'base_url' => 'https://cdn-api.ooyala.com/{api_version}', 'request.options' => array('timeout' => 0, 'connect_timeout' => 0))), 'cache.ooyala-client' => array('class' => 'SheKnows\\OoyalaApi\\OoyalaClient', 'params' => array('api_key' => $_SERVER['API_KEY'], 'api_secret' => $_SERVER['API_SECRET'], 'base_url' => 'https://cdn-api.ooyala.com/{api_version}', 'ooyala.cache' => array('max-age' => 900, 'stale-if-error' => 3600), 'request.options' => array('timeout' => 0, 'connect_timeout' => 0))), 'mock.ooyala-client' => array('class' => 'SheKnows\\OoyalaApi\\OoyalaClient', 'params' => array('api_key' => '123', 'api_secret' => '456', 'base_url' => 'http://test.local', 'request.options' => array('timeout' => 0, 'connect_timeout' => 0))))));
// Allow command line overrides if (get_cfg_var('CONFIG')) { $_SERVER['CONFIG'] = get_cfg_var('CONFIG'); } // Set the service configuration file if it was not provided from the CLI if (!isset($_SERVER['CONFIG'])) { $serviceConfig = $_SERVER['CONFIG'] = dirname(__DIR__) . '/test_services.json'; $_SERVER['CONFIG'] = $serviceConfig; if (!file_exists($serviceConfig)) { copy($serviceConfig . '.dist', $serviceConfig); } } if (!is_readable($_SERVER['CONFIG'])) { die("Unable to read service configuration from '{$_SERVER['CONFIG']}'\n"); } // If the global prefix is hostname, then use the crc32() of gethostname() if (!isset($_SERVER['PREFIX']) || $_SERVER['PREFIX'] == 'hostname') { $_SERVER['PREFIX'] = crc32(gethostname()); } // Instantiate the service builder $aws = Aws\Common\Aws::factory($_SERVER['CONFIG']); // Turn on wire logging if configured $aws->getEventDispatcher()->addListener('service_builder.create_client', function (\Guzzle\Common\Event $event) { if (isset($_SERVER['WIRE_LOGGING']) && $_SERVER['WIRE_LOGGING']) { $event['client']->addSubscriber(Guzzle\Plugin\Log\LogPlugin::getDebugPlugin()); } }); // Configure the tests to use the instantiated AWS service builder Guzzle\Tests\GuzzleTestCase::setServiceBuilder($aws); // Emit deprecation warnings Guzzle\Common\Version::$emitWarnings = true;
$class = str_replace('Guzzle\\Openstack\\Tests', '', $class); if ('\\' != DIRECTORY_SEPARATOR) { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'Guzzle/Openstack/Tests' . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; } else { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'Guzzle\\Openstack\\Tests' . DIRECTORY_SEPARATOR . $class . '.php'; } if (file_exists($class)) { require $class; return true; } } if (0 === strpos($class, 'Guzzle\\Openstack')) { $class = str_replace('Guzzle\\Openstack', '', $class); if ('\\' != DIRECTORY_SEPARATOR) { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Guzzle/Openstack' . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; } else { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Guzzle\\Openstack' . DIRECTORY_SEPARATOR . $class . '.php'; } if (file_exists($class)) { require $class; return true; } } return false; }); // Include the composer autoloader $loader = (require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . DIRECTORY_SEPARATOR . 'mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(\Guzzle\Service\Builder\ServiceBuilder::factory(array('test.abstract.os' => array('class' => '', 'params' => array('username' => 'admin', 'password' => 'openstack', 'token' => 'authenticationtoken')), 'test.identity' => array('extends' => 'test.abstract.os', 'class' => 'Guzzle.Openstack.Identity.IdentityClient', 'params' => array('base_url' => 'http://192.168.4.100:35357/v2.0/')), 'test.compute' => array('extends' => 'test.abstract.os', 'class' => 'Guzzle.Openstack.Compute.ComputeClient', 'params' => array('base_url' => 'http://192.168.4.100:8774/v2/', 'tenant_id' => 'tenantid')), 'test.storage' => array('extends' => 'test.abstract.os', 'class' => 'Guzzle.Openstack.Storage.StorageClient', 'params' => array('base_url' => 'http://192.168.4.100:8080/v1/', 'tenant_id' => 'tenantid')), 'test.openstack' => array('extends' => 'test.abstract.os', 'class' => 'Guzzle.Openstack.Openstack.OpenstackClient'))));
<?php error_reporting(-1); date_default_timezone_set('UTC'); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install\n\n" . "See http://getcomposer.org for help with installing composer\n"); } // Include the composer autoloader $loader = (require dirname(__DIR__) . '/vendor/autoload.php'); $loader->add('Ctc\\Test', __DIR__); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); // Emit deprecation warnings Guzzle\Common\Version::$emitWarnings = true;
// Allow command line overrides if (get_cfg_var('CONFIG')) { $_SERVER['CONFIG'] = get_cfg_var('CONFIG'); } // Set the service configuration file if it was not provided from the CLI if (!isset($_SERVER['CONFIG'])) { $serviceConfig = $_SERVER['CONFIG'] = dirname(__DIR__) . '/test_services.json'; $_SERVER['CONFIG'] = $serviceConfig; if (!file_exists($serviceConfig)) { die("test_services.json does not exist.\n" . "Please run phing test-init or copy test_services.json.dist to test_services.json\n\n"); } } if (!is_readable($_SERVER['CONFIG'])) { die("Unable to read service configuration from '{$_SERVER['CONFIG']}'\n"); } // If the global prefix is hostname, then use the crc32() of gethostname() if (!isset($_SERVER['PREFIX']) || $_SERVER['PREFIX'] == 'hostname') { $_SERVER['PREFIX'] = crc32(gethostname()); } // Instantiate the service builder $porot = Porot\Common\Porot::factory($_SERVER['CONFIG']); // Turn on wire logging if configured $porot->getEventDispatcher()->addListener('service_builder.create_client', function (\Guzzle\Common\Event $event) { if (isset($_SERVER['WIRE_LOGGING']) && $_SERVER['WIRE_LOGGING']) { $event['client']->addSubscriber(Guzzle\Plugin\Log\LogPlugin::getDebugPlugin()); } }); // Configure the tests to ise the instantiated AWS service builder Guzzle\Tests\GuzzleTestCase::setServiceBuilder($porot); // Emit deprecation warnings Guzzle\Common\Version::$emitWarnings = true;