本文整理匯總了PHP中DboSource::boolean方法的典型用法代碼示例。如果您正苦於以下問題:PHP DboSource::boolean方法的具體用法?PHP DboSource::boolean怎麽用?PHP DboSource::boolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DboSource
的用法示例。
在下文中一共展示了DboSource::boolean方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testBooleanNormalization
/**
* Tests that different Postgres boolean 'flavors' are properly returned as native PHP booleans
*
* @access public
* @return void
*/
function testBooleanNormalization()
{
$this->assertTrue($this->db2->boolean('t'));
$this->assertTrue($this->db2->boolean('true'));
$this->assertTrue($this->db2->boolean('TRUE'));
$this->assertTrue($this->db2->boolean(true));
$this->assertTrue($this->db2->boolean(1));
$this->assertTrue($this->db2->boolean(" "));
$this->assertFalse($this->db2->boolean('f'));
$this->assertFalse($this->db2->boolean('false'));
$this->assertFalse($this->db2->boolean('FALSE'));
$this->assertFalse($this->db2->boolean(false));
$this->assertFalse($this->db2->boolean(0));
$this->assertFalse($this->db2->boolean(''));
}
示例2: testBooleanNormalization
/**
* Tests that different Postgres boolean 'flavors' are properly returned as native PHP booleans
*
* @return void
*/
public function testBooleanNormalization()
{
$this->assertEquals(true, $this->Dbo2->boolean('t', false));
$this->assertEquals(true, $this->Dbo2->boolean('true', false));
$this->assertEquals(true, $this->Dbo2->boolean('TRUE', false));
$this->assertEquals(true, $this->Dbo2->boolean(true, false));
$this->assertEquals(true, $this->Dbo2->boolean(1, false));
$this->assertEquals(true, $this->Dbo2->boolean(" ", false));
$this->assertEquals(false, $this->Dbo2->boolean('f', false));
$this->assertEquals(false, $this->Dbo2->boolean('false', false));
$this->assertEquals(false, $this->Dbo2->boolean('FALSE', false));
$this->assertEquals(false, $this->Dbo2->boolean(false, false));
$this->assertEquals(false, $this->Dbo2->boolean(0, false));
$this->assertEquals(false, $this->Dbo2->boolean('', false));
}
示例3: testBooleanNormalization
/**
* Tests that different Postgres boolean 'flavors' are properly returned as native PHP booleans
*
* @return void
*/
public function testBooleanNormalization()
{
$this->assertEquals(TRUE, $this->Dbo2->boolean('t', FALSE));
$this->assertEquals(TRUE, $this->Dbo2->boolean('true', FALSE));
$this->assertEquals(TRUE, $this->Dbo2->boolean('TRUE', FALSE));
$this->assertEquals(TRUE, $this->Dbo2->boolean(TRUE, FALSE));
$this->assertEquals(TRUE, $this->Dbo2->boolean(1, FALSE));
$this->assertEquals(TRUE, $this->Dbo2->boolean(" ", FALSE));
$this->assertEquals(FALSE, $this->Dbo2->boolean('f', FALSE));
$this->assertEquals(FALSE, $this->Dbo2->boolean('false', FALSE));
$this->assertEquals(FALSE, $this->Dbo2->boolean('FALSE', FALSE));
$this->assertEquals(FALSE, $this->Dbo2->boolean(FALSE, FALSE));
$this->assertEquals(FALSE, $this->Dbo2->boolean(0, FALSE));
$this->assertEquals(FALSE, $this->Dbo2->boolean('', FALSE));
}