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