<?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;
Example #2
0
<?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');