本文整理匯總了PHP中Guzzle\Service\Description\Parameter::addFilter方法的典型用法代碼示例。如果您正苦於以下問題:PHP Parameter::addFilter方法的具體用法?PHP Parameter::addFilter怎麽用?PHP Parameter::addFilter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Guzzle\Service\Description\Parameter
的用法示例。
在下文中一共展示了Parameter::addFilter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCanBuildUpParams
public function testCanBuildUpParams()
{
$p = new Parameter(array());
$p->setName('foo')->setDescription('c')->setFilters(array('d'))->setLocation('e')->setSentAs('f')->setMaxLength(1)->setMinLength(1)->setMinimum(2)->setMaximum(2)->setMinItems(3)->setMaxItems(3)->setRequired(true)->setStatic(true)->setDefault('h')->setType('i');
$p->addFilter('foo');
$this->assertEquals('foo', $p->getName());
$this->assertEquals('h', $p->getDefault());
$this->assertEquals('c', $p->getDescription());
$this->assertEquals(array('d', 'foo'), $p->getFilters());
$this->assertEquals('e', $p->getLocation());
$this->assertEquals('f', $p->getSentAs());
$this->assertEquals(1, $p->getMaxLength());
$this->assertEquals(1, $p->getMinLength());
$this->assertEquals(2, $p->getMaximum());
$this->assertEquals(2, $p->getMinimum());
$this->assertEquals(3, $p->getMaxItems());
$this->assertEquals(3, $p->getMinItems());
$this->assertEquals(true, $p->getRequired());
$this->assertEquals(true, $p->getStatic());
$this->assertEquals('i', $p->getType());
}