コード例 #1
0
<?php

use Guzzle\Tests\GuzzleTestCase;
use Guzzle\Service\Builder\ServiceBuilder;
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");
}
require dirname(__DIR__) . '/vendor/autoload.php';
GuzzleTestCase::setMockBasePath(__DIR__ . '/mock');
GuzzleTestCase::setServiceBuilder(ServiceBuilder::factory(array('ga_measurement_protocol' => array('class' => 'Krizon\\Google\\Analytics\\MeasurementProtocol\\MeasurementProtocolClient', 'params' => array()))));
コード例 #2
0
<?php

use Guzzle\Tests\GuzzleTestCase;
use Guzzle\Service\Builder\ServiceBuilder;
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');
// Set mock directory for Tika command responses.
GuzzleTestCase::setMockBasePath(__DIR__ . DIRECTORY_SEPARATOR . 'mock');
// Add the services file to the default service builder
GuzzleTestCase::setServiceBuilder(ServiceBuilder::factory(array('base' => array('class' => 'Bangpound\\Tika\\Client'), 'test.tika' => array('extends' => 'base', 'params' => array('base_url' => $_SERVER['TIKA_URL'])), 'test.mock' => array('extends' => 'base', 'params' => array()))));
コード例 #3
0
ファイル: bootstrap.php プロジェクト: wisembly/semantria-php
<?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']]]));
コード例 #4
0
ファイル: bootstrap.php プロジェクト: sgulseth/imboclient-php
<?php

/**
 * This file is part of the ImboClient package
 *
 * (c) Christer Edvartsen <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE file that was
 * distributed with this source code.
 */
namespace ImboClientTest;

use Guzzle\Tests\GuzzleTestCase, Guzzle\Service\Builder\ServiceBuilder;
require __DIR__ . '/../vendor/autoload.php';
// Set a default service builder for the tests
$serviceDescription = (require __DIR__ . '/../src/ImboClient/service.php');
GuzzleTestCase::setServiceBuilder(ServiceBuilder::factory($serviceDescription['operations']));
// Set the base path for respones mocks
GuzzleTestCase::setMockBasePath(__DIR__ . '/response_mocks');
コード例 #5
0
<?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);