本文整理匯總了PHP中PersistableFilter::setDisplayName方法的典型用法代碼示例。如果您正苦於以下問題:PHP PersistableFilter::setDisplayName方法的具體用法?PHP PersistableFilter::setDisplayName怎麽用?PHP PersistableFilter::setDisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PersistableFilter
的用法示例。
在下文中一共展示了PersistableFilter::setDisplayName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testInstantiationAndExecute
/**
* @covers PersistableFilter
*/
public function testInstantiationAndExecute()
{
$constructorArg = PersistableFilter::tempGroup('class::lib.pkp.tests.classes.filter.TestClass1', 'class::lib.pkp.tests.classes.filter.TestClass2');
$testFilter = new PersistableFilter($constructorArg);
// Test getters/setters that are not implicitly tested by other tests
self::assertInstanceOf('FilterGroup', $testFilter->getFilterGroup());
$testFilter->setDisplayName('Some other display name');
$testFilter->setIsTemplate(1);
self::assertTrue($testFilter->getIsTemplate());
self::assertEquals(0, $testFilter->getParentFilterId());
$testFilter->setParentFilterId(1);
self::assertEquals(1, $testFilter->getParentFilterId());
// Test settings
self::assertFalse($testFilter->hasSettings());
$testSetting = new EmailFilterSetting('testEmail', 'Test Email', 'Test Email is required');
$testSetting2 = new EmailFilterSetting('testEmail2', 'Test Email2', 'Test Email2 is required');
$testSetting2->setIsLocalized(true);
$testFilter->addSetting($testSetting);
$testFilter->addSetting($testSetting2);
self::assertEquals(array('testEmail' => $testSetting, 'testEmail2' => $testSetting2), $testFilter->getSettings());
self::assertTrue($testFilter->hasSettings());
self::assertEquals(array('testEmail'), $testFilter->getSettingNames());
self::assertEquals(array('testEmail2'), $testFilter->getLocalizedSettingNames());
self::assertTrue($testFilter->hasSetting('testEmail'));
self::assertEquals($testSetting, $testFilter->getSetting('testEmail'));
// Test type validation.
$typeDescriptionFactory = TypeDescriptionFactory::getInstance();
$inputTypeDescription = 'class::lib.pkp.tests.classes.filter.TestClass1';
$outputTypeDescription = 'class::lib.pkp.tests.classes.filter.TestClass2';
self::assertEquals($inputTypeDescription, $testFilter->getInputType()->getTypeDescription());
self::assertEquals($outputTypeDescription, $testFilter->getOutputType()->getTypeDescription());
}