當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DboSource::boolean方法代碼示例

本文整理匯總了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(''));
 }
開發者ID:jerzzz777,項目名稱:cake-cart,代碼行數:21,代碼來源:dbo_postgres.test.php

示例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));
 }
開發者ID:jeffersongoncalves,項目名稱:estudos,代碼行數:20,代碼來源:PostgresTest.php

示例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));
 }
開發者ID:mrbadao,項目名稱:api-official,代碼行數:20,代碼來源:PostgresTest.php


注:本文中的DboSource::boolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。