本文整理匯總了PHP中JLanguage::setDebug方法的典型用法代碼示例。如果您正苦於以下問題:PHP JLanguage::setDebug方法的具體用法?PHP JLanguage::setDebug怎麽用?PHP JLanguage::setDebug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JLanguage
的用法示例。
在下文中一共展示了JLanguage::setDebug方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetSetDebug
/**
* Test...
*
* @covers JLanguage::setDebug
* @covers JLanguage::getDebug
*
* @return void
*/
public function testGetSetDebug()
{
$current = $this->object->getDebug();
$this->assertEquals(
$current,
$this->object->setDebug(true),
'Line: ' . __LINE__
);
$this->object->setDebug(false);
$this->assertFalse(
$this->object->getDebug(),
'Line: ' . __LINE__
);
$this->object->setDebug(true);
$this->assertTrue(
$this->object->getDebug(),
'Line: ' . __LINE__
);
$this->object->setDebug(0);
$this->assertFalse(
$this->object->getDebug(),
'Line: ' . __LINE__
);
$this->object->setDebug(1);
$this->assertTrue(
$this->object->getDebug(),
'Line: ' . __LINE__
);
$this->object->setDebug('');
$this->assertFalse(
$this->object->getDebug(),
'Line: ' . __LINE__
);
$this->object->setDebug('test');
$this->assertTrue(
$this->object->getDebug(),
'Line: ' . __LINE__
);
$this->object->setDebug('0');
$this->assertFalse(
$this->object->getDebug(),
'Line: ' . __LINE__
);
}
示例2: testSetDebug
/**
* @todo Implement testSetDebug().
*/
public function testSetDebug()
{
$debug1 = 'phpunit';
$debug2 = 'selenium';
$lang = new JLanguage('');
// First time, retuns FALSE
$this->assertFalse($lang->setDebug($debug1));
// set debug1, returns $debug1
$debug = $lang->setDebug($debug1);
$this->assertEquals($debug1, $debug, 'Line: ' . __LINE__);
$this->assertNotEquals($debug2, $debug, 'Line: ' . __LINE__);
// set debug2, returns debug1
$debug = $lang->setDebug($debug2);
$this->assertEquals($debug1, $debug, 'Line: ' . __LINE__);
$this->assertNotEquals($debug2, $debug, 'Line: ' . __LINE__);
// set debug2 (or debug1), returns debug2
$debug = $lang->setDebug($debug2);
$this->assertEquals($debug2, $debug, 'Line: ' . __LINE__);
$this->assertNotEquals($debug1, $debug, 'Line: ' . __LINE__);
}