本文整理匯總了PHP中JLanguage::getPluralSuffixesCallback方法的典型用法代碼示例。如果您正苦於以下問題:PHP JLanguage::getPluralSuffixesCallback方法的具體用法?PHP JLanguage::getPluralSuffixesCallback怎麽用?PHP JLanguage::getPluralSuffixesCallback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JLanguage
的用法示例。
在下文中一共展示了JLanguage::getPluralSuffixesCallback方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testSetPluralSuffixesCallback
/**
* Test...
*
* @covers JLanguage::setPluralSuffixesCallback
* @covers JLanguage::getPluralSuffixesCallback
*
* @return void
*/
public function testSetPluralSuffixesCallback()
{
$function1 = 'phpinfo';
$function2 = 'print';
$lang = new JLanguage('');
$this->assertTrue(is_callable($lang->getPluralSuffixesCallback()));
$this->assertTrue(is_callable($lang->setPluralSuffixesCallback($function1)));
$get = $lang->getPluralSuffixesCallback();
$this->assertEquals($function1, $get, 'Line: ' . __LINE__);
$this->assertNotEquals($function2, $get, 'Line: ' . __LINE__);
// Note: set -> $function2: set returns $function1 and get retuns $function2
$set = $lang->setPluralSuffixesCallback($function2);
$this->assertEquals($function1, $set, 'Line: ' . __LINE__);
$this->assertNotEquals($function2, $set, 'Line: ' . __LINE__);
$this->assertEquals($function2, $lang->getPluralSuffixesCallback(), 'Line: ' . __LINE__);
$this->assertNotEquals($function1, $lang->getPluralSuffixesCallback(), 'Line: ' . __LINE__);
}