本文整理汇总了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());
}
示例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']);
}
示例3: testSetHost
public function testSetHost()
{
$configuration = new Configuration('my-host');
$configuration->setHost('other-host');
$this->assertAttributeEquals('other-host', 'host', $configuration);
}