当前位置: 首页>>代码示例>>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;未经允许,请勿转载。