/** * @Given /^I have set the client to use http:\/\/ckan\.net\/api as the base url$/ */ public function iHaveSetTheClientToUseHttpCkanNetApiAsTheBaseUrl() { $this->ckanClient = Guzzle\Service\Builder\ServiceBuilder::factory(array('dev.ckan' => array('class' => 'Silex\\ckan\\CkanClient', 'params' => array('baseUrl' => 'http://co-prod2.dh.bytemark.co.uk/api/', 'apiKey' => 'ee95fd59-3990-4e89-8142-a962d6005ab6'))))->get('dev.ckan'); }
<?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')))));
<?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'))));
* 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 // 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('Mgrt\\\\Test', __DIR__); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); // Check credentials if (!isset($_SERVER['PUBLIC_KEY']) || !isset($_SERVER['PRIVATE_KEY'])) { die("Unable to get your public_key or private_key \n"); } // Instantiate the service builder $api = \Mgrt\Client::factory(array('public_key' => $_SERVER['PUBLIC_KEY'], 'private_key' => $_SERVER['PRIVATE_KEY'])); // Configure the tests to ise the instantiated MailingReport service builder $serviceBuilder = new Guzzle\Service\Builder\ServiceBuilder(); $serviceBuilder->set('mgrt', $api); Guzzle\Tests\GuzzleTestCase::setServiceBuilder($serviceBuilder); // Emit deprecation warnings Guzzle\Common\Version::$emitWarnings = true;
<?php error_reporting(E_ALL | E_STRICT); //require_once 'PHPUnit/TextUI/TestRunner.php'; require dirname(__DIR__) . '/vendor/autoload.php'; // Add the services file to the default service builder $servicesFile = __DIR__ . '/Guzzle/Tests/TestData/services/services.json'; $builder = Guzzle\Service\Builder\ServiceBuilder::factory($servicesFile); Guzzle\Tests\GuzzleTestCase::setServiceBuilder($builder);
<?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 use Guzzle\Tests\GuzzleTestCase; include __DIR__ . '/../vendor/autoload.php'; // Mocks path $mock_basepath = __DIR__ . '/Mock/'; GuzzleTestCase::setMockBasePath($mock_basepath); // Service Builder for tests Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(['semantria.auth' => ['class' => 'Semantria.SemantriaAuthClient', 'params' => ['consumer_key' => 'foo', 'consumer_secret' => 'bar']]]));
<?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 use Guzzle\Tests\GuzzleTestCase; include __DIR__ . '/../vendor/autoload.php'; Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('test.meetup.key' => array('class' => 'DMS.Service.Meetup.MeetupKeyAuthClient', 'params' => array('key' => 'mykey')), 'test.meetup.oauth' => array('class' => 'DMS.Service.Meetup.MeetupOauthAuthClient', 'params' => array('consumer_key' => 'key', 'consumer_secret' => 'secret', 'token' => 'token', 'token_secret' => 'token_secret'))))); $basePath = __DIR__ . '/mock/'; GuzzleTestCase::setMockBasePath($basePath);
<?php //Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Aws\Common\Aws::factory($_SERVER['CONFIG'])); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('test.ckan' => array('class' => 'Silex\\ckan\\CkanClient', 'params' => array())))); Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock');
<?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)))));
<?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'])))));
<?php /** * User: Joe Linn * Date: 7/9/13 * Time: 11:25 AM */ error_reporting(E_ALL | E_STRICT); require_once 'PHPUnit/TextUI/TestRunner.php'; //composer autoloader $autoloader = (require dirname(__DIR__) . '/vendor/autoload.php'); $config = json_decode(file_get_contents($_SERVER['CONFIG']), true); \Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('test.mixpanel' => array('class' => 'MixGuzzle\\MixGuzzleClient', 'params' => $config))));
<?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 $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 /** * User: Tabaré Caorsi <*****@*****.**> * Date: 8/21/13 * Time: 10:19 AM * * Boostrap the php unit environment */ require_once realpath(dirname(__FILE__) . "/../vendor/autoload.php"); $serviceBuilder = new Guzzle\Service\Builder\ServiceBuilder(); // regular api client $serviceBuilder->set('test.sparkreel', \Sparkreel\Sdk\SparkreelClient::factory(array("base_url" => "https://api.sparkreel/v1", "api_key" => "YmM4ZmY5OTQ0OTFjMDdjM2M0OGExODNkZmI2OThiOTQwOWZiOTAwOA==", 'ssl.certificate_authority' => 'system', 'curl.options' => array(CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_SSL_VERIFYHOST => 0)))); // OAuth2 client $serviceBuilder->set('test.oauth', \Sparkreel\Sdk\OAuth2\Client::factory(array('scheme' => 'http', 'hostname' => 'www.dev.sparkreel.com', 'client_id' => 'demoreel', 'client_secret' => 'demo_secret', 'ssl.certificate_authority' => 'system', 'curl.options' => array(CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_SSL_VERIFYHOST => 0)))); Guzzle\Tests\GuzzleTestCase::setServiceBuilder($serviceBuilder); //Set response mocks directory Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); define("TEST_VIDEOS_PATH", __DIR__ . '/videos'); define("TEST_IMAGES_PATH", __DIR__ . '/images');
<?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))))));
<?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 use Guzzle\Tests\GuzzleTestCase; include __DIR__ . '/../vendor/autoload.php'; // Mocks path $mock_basepath = __DIR__ . '/Mock/'; GuzzleTestCase::setMockBasePath($mock_basepath); // Service Builder for tests Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(['intercom.basicauth' => ['class' => 'Intercom.IntercomBasicAuthClient', 'params' => ['api_key' => $_SERVER['INTERCOM_API_KEY'], 'app_id' => $_SERVER['INTERCOM_APP_ID']]]]));