本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Client::setServerParameters方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::setServerParameters方法的具体用法?PHP Client::setServerParameters怎么用?PHP Client::setServerParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Client
的用法示例。
在下文中一共展示了Client::setServerParameters方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
public function logout()
{
$this->client->setServerParameters(array());
$this->client->getCookieJar()->clear();
$this->user = null;
$this->pageEleveur = null;
}
示例2: setUp
protected function setUp()
{
static::$client = static::createClient();
$container = static::$client->getContainer();
$sapiToken = $container->getParameter('storage_api.test.token');
$sapiUrl = $container->getParameter('storage_api.test.url');
static::$client->setServerParameters(array('HTTP_X-StorageApi-Token' => $sapiToken));
}
示例3: setUp
/**
* Setup HTTP client, command runner and Storage API client for each test
*/
protected function setUp()
{
$this->httpClient = static::createClient();
$container = $this->httpClient->getContainer();
if (!$this->storageApiToken) {
$this->storageApiToken = $container->getParameter('storage_api.test.token');
}
$this->httpClient->setServerParameters(['HTTP_X-StorageApi-Token' => $this->storageApiToken]);
$this->jobMapper = $container->get('syrup.elasticsearch.current_component_job_mapper');
$application = new Application($this->httpClient->getKernel());
$application->add(new JobCommand());
$command = $application->find('syrup:run-job');
$this->commandTester = new CommandTester($command);
$this->storageApiClient = new StorageApiClient(['token' => $this->storageApiToken, 'url' => $container->getParameter('storage_api.test.url')]);
}
示例4: createClient
/**
* {@inheritdoc}
*/
protected static function createClient(array $options = array(), array $server = array())
{
static::bootKernel($options);
$client = new Client(static::$kernel);
$client->setServerParameters($server);
return $client;
}
示例5: setUp
protected function setUp()
{
self::$client = static::createClient();
$this->container = self::$client->getContainer();
$sapiToken = $this->container->getParameter('storage_api.test.token');
$sapiUrl = $this->container->getParameter('storage_api.test.url');
self::$client->setServerParameters(array('HTTP_X-StorageApi-Token' => $sapiToken));
$this->storageApi = new SapiClient(['token' => $sapiToken, 'url' => $sapiUrl, 'userAgent' => 'ex-db']);
$this->manager = new Manager($this->storageApi, $this->componentName);
// Cleanup
$sysBucketId = $this->manager->getSysBucketId();
$accTables = $this->storageApi->listTables($sysBucketId);
foreach ($accTables as $table) {
$this->storageApi->dropTable($table['id']);
}
}
示例6: request
/**
* {@inheritdoc}
*/
public function request($method, $uri, array $parameters = array(), array $files = array(), array $server = array(), $content = null, $changeHistory = true)
{
if (strpos($uri, 'http://') === false) {
$uri = self::LOCAL_URL . $uri;
}
if ($this->getServerParameter('HTTP_X-WSSE', '') !== '' && !isset($server['HTTP_X-WSSE'])) {
//generate new WSSE header
parent::setServerParameters(WebTestCase::generateWsseAuthHeader());
}
return parent::request($method, $uri, $parameters, $files, $server, $content, $changeHistory);
}
示例7: setUp
protected function setUp()
{
self::$client = static::createClient();
$container = self::$client->getContainer();
$sapiToken = $container->getParameter('storage_api.test.token');
$sapiUrl = $container->getParameter('storage_api.test.url');
self::$client->setServerParameters(array('HTTP_X-StorageApi-Token' => $sapiToken));
$this->storageApi = new SapiClient(['token' => $sapiToken, 'url' => $sapiUrl, 'userAgent' => $this->componentName]);
$this->encryptor = $container->get('syrup.encryptor');
$this->configuration = $container->get('ex_google_drive.configuration');
$this->configuration->setStorageApi($this->storageApi);
try {
$this->configuration->create();
} catch (\Exception $e) {
// bucket exists
}
// Cleanup
$sysBucketId = $this->configuration->getSysBucketId();
$tableId = $sysBucketId . '.' . $this->accountId;
if ($this->storageApi->tableExists($tableId)) {
$this->storageApi->dropTable($tableId);
}
}
示例8: setUp
protected function setUp($driver = null)
{
self::$client = static::createClient();
$this->container = self::$client->getContainer();
$sapiToken = $this->container->getParameter('storage_api.test.token');
$sapiUrl = $this->container->getParameter('storage_api.test.url');
self::$client->setServerParameters(['HTTP_X-StorageApi-Token' => $sapiToken]);
$this->storageApi = new SapiClient(['token' => $sapiToken, 'url' => $sapiUrl, 'userAgent' => $this->componentName]);
if ($driver != null) {
$this->configuration = new Configuration($this->componentName . '-' . $driver, $this->storageApi, $driver);
} else {
$this->configuration = new Configuration($this->componentName, $this->storageApi);
}
// Cleanup
$sysBucketId = $this->configuration->getSysBucketId($this->writerId);
if ($this->storageApi->bucketExists($sysBucketId)) {
$accTables = $this->storageApi->listTables($sysBucketId);
foreach ($accTables as $table) {
$this->storageApi->dropTable($table['id']);
}
$this->storageApi->dropBucket($sysBucketId);
}
}
示例9: setupStorageApi
/**
* Setup storage api from AbstractTest::storageApiToken
*/
protected function setupStorageApi()
{
$this->httpClient->setServerParameters(array('HTTP_X-StorageApi-Token' => $this->storageApiToken));
$this->storageApi = new StorageApiClient(array('token' => $this->storageApiToken, 'url' => TEST_ORCHESTRATOR_SAPI_URL));
$this->token = new StorageApiToken($this->storageApi);
}
示例10: setServerParameters
/**
* Sets server parameters.
*
* @param array $server An array of server parameters
*
* @api
*/
public function setServerParameters(array $server)
{
$this->subject->setServerParameters($server);
}