當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Configuration::setHost方法代碼示例

本文整理匯總了PHP中Configuration::setHost方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configuration::setHost方法的具體用法?PHP Configuration::setHost怎麽用?PHP Configuration::setHost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Configuration的用法示例。


在下文中一共展示了Configuration::setHost方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testConfiguration

 /**
  * Base test configuration
  */
 public function testConfiguration()
 {
     $c = new Configuration('name', 'localhost', 80);
     $this->assertEquals('name', $c->getName());
     $this->assertEquals('new_name', $c->setName('new_name')->getName());
     $this->assertEquals('localhost', $c->getHost());
     $this->assertEquals('new_localhost', $c->setHost('new_localhost')->getHost());
     $this->assertEquals(80, $c->getPort());
     $this->assertEquals(8080, $c->setPort(8080)->getPort());
     $this->assertEquals('user', $c->setUser('user')->getUser());
     $this->assertEquals('password', $c->setPassword('password')->getPassword());
     $this->assertEquals('password', $c->setPassPhrase('password')->getPassPhrase());
     $this->assertEquals(0, $c->setAuthenticationMethod(0)->getAuthenticationMethod());
     $this->assertEquals((isset($_SERVER['HOME']) ? $_SERVER['HOME'] : '~') . '/.config', $c->setConfigFile('~/.config')->getConfigFile());
     $this->assertEquals((isset($_SERVER['HOME']) ? $_SERVER['HOME'] : '~') . '/.pem', $c->setPemFile('~/.pem')->getPemFile());
     $this->assertEquals((isset($_SERVER['HOME']) ? $_SERVER['HOME'] : '~') . '/.pub', $c->setPublicKey('~/.pub')->getPublicKey());
     $this->assertEquals((isset($_SERVER['HOME']) ? $_SERVER['HOME'] : '~') . '/.private', $c->setPrivateKey('~/.private')->getPrivateKey());
 }
開發者ID:acorncom,項目名稱:deployer,代碼行數:21,代碼來源:ConfigurationTest.php

示例2: testGetInventory

 public function testGetInventory()
 {
     // initialize the API client
     $config = new Configuration();
     $config->setHost('http://petstore.swagger.io/v2');
     $api_client = new APIClient($config);
     $store_api = new Api\StoreApi($api_client);
     // get inventory
     $get_response = $store_api->getInventory();
     $this->assertInternalType("int", $get_response['sold']);
     $this->assertInternalType("int", $get_response['pending']);
 }
開發者ID:ModelSolv,項目名稱:swagger-codegen,代碼行數:12,代碼來源:PetApiTest.php

示例3: testSetHost

 public function testSetHost()
 {
     $configuration = new Configuration('my-host');
     $configuration->setHost('other-host');
     $this->assertAttributeEquals('other-host', 'host', $configuration);
 }
開發者ID:jimigrunge,項目名稱:php-ssh,代碼行數:6,代碼來源:ConfigurationTest.php


注:本文中的Configuration::setHost方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。